If I enter the following in to the console of R:
1 - 3.125e-09
It prints 1
as its result.
However, a logical test will show that it is not actually 1
.
if ( (1-3.125e-09) == 1){
print('Number is equal to one')
} else {
print('Number is not one')
}
How is this happening? How can I capture the true value? This behavior appears to break some graphing library functions where the total value should add up to 1.