bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Awk cannot properly deal with too small numbers.


From: Wolfgang Laun
Subject: Re: [bug-gawk] Awk cannot properly deal with too small numbers.
Date: Sat, 16 Apr 2016 16:22:48 +0200

On 16 April 2016 at 10:38, Luuk <address@hidden> wrote:


On 15-04-16 02:21, Wolfgang Laun wrote:
Note that this works:

$ echo 1.1e-309 | awk '$1+0 < 0.05{ print $1;}'
1.1e-309

Because of this

$ echo 1.1e-309 | awk '$1 < 2.05{ print $1;}'
1.1e-309

and similar experiments I'd call the difference in behaviour surprising.



$ echo 1.1e-309 | awk '{ print $1, $1+0, $1+0<0.05, $1<2.05;}'
1.1e-309 0 1 1


$1+0 equesl 0, which is smaller than 0.05

'1.1e-309' seems to be smaller than 2.05  also ....

but nothing surprising here....


The "surprising" was meant in comparison to OP's original statement:

    $ echo 1.1e-309 | awk '$1<0.05{print}’

Now isn't 1.1e-309 smaller than 0.05 as well?

reply via email to

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