[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Is -M enabled by default?
From: |
Peng Yu |
Subject: |
Re: [bug-gawk] Is -M enabled by default? |
Date: |
Mon, 12 Feb 2018 18:20:09 -0600 |
> Just change the loop limit in your original version from 1023 to 1025;
> when i = 1024, the output number changes to "inf", because the computation
> has overflowed. The largest IEEE 754 64-bit binary format number is
> +0x1.fffffffffffffp+1023 ~= 1.797_693_134_862_315_7e+308.
diff <(awk -e 'BEGIN{ x = 1; for(i=1;i<1025;++i) { x = x * 2; print i,
x } }') <(awk -M -e 'BEGIN{ x = 1; for(i=1;i<1025;++i) { x = x * 2;
print i, x } }')
Now, it shows the difference.
But it is still better to have a direct way to show the type info of
variables used in awk instead of using this indirect way. Is there a
direct way? Thanks.
--
Regards,
Peng
Re: [bug-gawk] Is -M enabled by default?, arnold, 2018/02/13