there appears to be discrepancy regarding what each flavor of awk considers the smallest figure before it underflows to zero:
mawk 1.3.4 | mawk 1.9.9.6 | macos built-in nawk
all say2^-1074
or4.94 x 10^-324
but gawk 5.1.0 (w/o activating GMP or MPFR) ends at
2^-1023
or1.11 x 10^-308
which one is the IEEE 754-compliant one here ?
=====================================
ps : thanks for everyone's replies. i found 2 workarounds with gawk :
exp(-log(2)*(1024-1+52-1))
or
2^-(1024-1) * 2^-(52-1)
- i typed it out more verbosely to make it easier to follow along regarding how the figures were derived. for shorter hand,they're
exp(-1074 * log(2))
(2^-51) * (2^-1023)
According to GNU AWK manual - Setting precision
Table 16.4: Predefined precision strings for
PRECAs you might deduce from above default setting (53-bit) is none of IEEE 754. You need to set
PRECto one of above if you need behavior compliant with IEEE 754.