bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] pretty-print rounds to "%.6g"


From: Hermann Peifer
Subject: Re: [bug-gawk] pretty-print rounds to "%.6g"
Date: Wed, 5 Oct 2016 06:21:41 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

Hi again,

The earlier reported rounding issue was fixed at the time: for integer
values. I just noted that float values continue to to rounded, in
gawk/master:

$ gawk -o- 'BEGIN{ x = .9999999 }'
BEGIN {
        x = 1
}

Hermann


On 2015-09-03 18:44, Hermann Peifer wrote:
> Hi,
> 
> I just came across the below rounding issue in pretty-printed code. Not
> sure if this is a feature or rather a (small) bug.
> 
> Hermann
> 
> 
> $ awk -o/dev/stdout 'BEGIN{ for(i=1420066800; i<=1451602800; i+=3600)
> print i}'
> BEGIN {
>     for (i = 1.42007e+09; i <= 1.4516e+09; i += 3600) {
>         print i
>     }
> }




reply via email to

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