bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Overflow to Infinity


From: Andrew J. Schorr
Subject: Re: [bug-gawk] Overflow to Infinity
Date: Tue, 19 Jun 2018 08:51:39 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

On Tue, Jun 19, 2018 at 06:44:42AM -0600, address@hidden wrote:
> What system are you running on?  On a handy Linux system, I actually
> get 'inf' for those values.

That's odd; I don't. On CentOS 7.5 using gawk built from the master
branch:

bash-4.2$ uname -a
Linux ti129 3.10.0-862.3.2.el7.x86_64 #1 SMP Mon May 21 23:36:36 UTC 2018 
x86_64 x86_64 x86_64 GNU/Linux
bash-4.2$ cat /tmp/test.awk 
BEGIN {
    n = split ("0 0.3 1e+30 1.2e+301 1.2e+311 1.2e+321 1.2e+331 1.2e+931 
1.2e+9999 1.2e+9999999", a)

    for (i=1; i<=n; ++i)
        print a[i], +a[i]
}
bash-4.2$ ./gawk -f /tmp/test.awk 
0 0
0.3 0.3
1e+30 1000000000000000019884624838656
1.2e+301 
12000000000000000630057123062453042984453622973297909858990249386141629495866898349436456500965374368524453325994606538123310278824325166907737506217440483794180646411118909644853962805537457080712427438819649599340973428467611690560895832913361709934951105465840682114057388033666356642385512806481920
1.2e+311 0
1.2e+321 0
1.2e+331 0
1.2e+931 0
1.2e+9999 0
1.2e+9999999 0

After patching with attached:

bash-4.2$ ./gawk -f /tmp/test.awk 
0 0
0.3 0.3
1e+30 1000000000000000019884624838656
1.2e+301 
12000000000000000630057123062453042984453622973297909858990249386141629495866898349436456500965374368524453325994606538123310278824325166907737506217440483794180646411118909644853962805537457080712427438819649599340973428467611690560895832913361709934951105465840682114057388033666356642385512806481920
1.2e+311 inf
1.2e+321 inf
1.2e+331 inf
1.2e+931 inf
1.2e+9999 inf
1.2e+9999999 inf

Regards,
Andy

Attachment: erange.patch
Description: Text document


reply via email to

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