[R] Inconsistency using seq

hamoreno hamoreno at asu.edu
Mon Jun 18 21:58:13 CEST 2012


Hi all,

Is there any problem of precision when using seq?. For example:

x<- seq(0,4,0.1)
x[4]=0.3

BUT:

x[4]-0.3=5.551115e-17

It means when I use this condition within an if clause, it does not find
values with 0.3 for x[4] as it is not precisely 0.3.
Is there any bug in seq() ?


--
View this message in context: http://r.789695.n4.nabble.com/Inconsistency-using-seq-tp4633739.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list