bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] string misinterpretation


From: Davide Brini
Subject: Re: [bug-gawk] string misinterpretation
Date: Tue, 30 Apr 2013 10:43:14 +0200

On Mon, 29 Apr 2013 15:20:37 -0700, "Love, Mr. Gary, Contractor, Code 7542"
<address@hidden> wrote:

> Developers,
> 
> I encountered a problem when a value is extracted from a field using the
> substr function and is then used in a conditional numeric test.  The test
> fails unless I multiple the substr value by 1.0 because the parser thinks
> the value is a string.
> 
> The attached code and data file demonstrate the problem. The workaround
> for the problem is to change line 5 From:
>                          incrm=substr($0,191,14)
> To:
>                          incrm=1.0*substr($0,191,14)

It works for me with gawk 4.0.2 without having to change anything. (btw, the
usual way to force numeric interpretation is adding 0, but I guess
multiplying by 1 also works).

-- 
D.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]