The following function, 'bitC' from ?numToBits, displays the bits in a
double precision number, separated into the sign bit, the 11 exponent bits,
and the 52 bits in the mantissa. I've shown the results with your numbers
from R-2.4.0 on my Windows 11 Lenovo laptop: what do you get?
# [1] 0 10001010010 | 0000100010110010101000101100001010000000001010010001
-Bill
On Sun, Jul 10, 2022 at 7:00 AM Antoine Fabri <antoine.fabri at gmail.com>
wrote:
Dear r-devel,
For some numbers, the printed value is not equivalent to the input :
options(scipen = 999)
## GOOD
1e24
#> [1] 999999999999999983222784
1e24 == 999999999999999983222784
#> [1] TRUE
## BAD
1e25
#> [1] 10000000000000000905969664
1e25 == 10000000000000000905969664
#> [1] FALSE
## STILL BAD
10000000000000000905969664
#> [1] 10000000000000003053453312
## GOOD AGAIN
10000000000000003053453312
#> [1] 10000000000000003053453312
# Additionally
10000000000000000000000000 == 1e25
#> [1] FALSE
Are these bugs ?
[[alternative HTML version deleted]]