r - Precision: (1-1e-17)==1 -
what's precision of r? can change it? find (1-1e-16)==1
false, (1-1e-17)==1
true.
i tried calculate
x = 1e-17 q1 = qnorm(x) q2 = qnorm(1-x)
theoretically q1==-q2
, output of r
> x=1e-17 > qnorm(x) [1] -8.493793 > qnorm(1-x) [1] inf
any way avoid such difference?
floating point precision depends on system. can relevant information help(".machine")
.
e.g., double.eps
"the smallest positive floating-point number x such 1 + x != 1".
.machine$double.eps #[1] 2.220446e-16
and double.neg.eps
"a small positive floating-point number x such 1 - x != 1".
.machine$double.neg.eps #[1] 1.110223e-16
Comments
Post a Comment