Displaying 2 results from an estimated 2 matches for "f89fc1a6f6613p".
2016 Dec 20
2
Very small numbers in hexadecimal notation parsed as zero
...y reported as 0 when coercing these numbers to double using
as.double()/as.numeric(), as illustrated in the three examples below:
as.double("0x1.00000000d0000p-987") # should be 7.645296e-298
as.double("0x1.0000000000000p-1022") # should be 2.225074e-308
as.double("0x1.f89fc1a6f6613p-974") # should be 1.23456e-293
The culprit seems to be the src/main/util.c:R_strtod function and in
some cases, removing the zeroes directly before the 'p' leads to
correct parsing:
as.double("0x1.00000000dp-987") # 7.645296e-298, as expected
as.double("0x1.p-1022...
2016 Dec 21
0
Very small numbers in hexadecimal notation parsed as zero
...numbers to double using
> as.double()/as.numeric(), as illustrated in the three examples below:
> as.double("0x1.00000000d0000p-987") # should be 7.645296e-298
> as.double("0x1.0000000000000p-1022") # should be 2.225074e-308
> as.double("0x1.f89fc1a6f6613p-974") # should be 1.23456e-293
> The culprit seems to be the src/main/util.c:R_strtod function and in
> some cases, removing the zeroes directly before the 'p' leads to
> correct parsing:
> as.double("0x1.00000000dp-987") # 7.645296e-298, as...