[Rd] Floating point issue

Antoine Fabri @nto|ne@|@br| @end|ng |rom gm@||@com
Sun Jul 10 16:00:02 CEST 2022


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]]



More information about the R-devel mailing list