Skip to content
Prev 11687 / 398502 Next

a problem with rep() ?

"S.McClatchie" wrote:
This happens because of computational (un)exactness:

  (1-0.8) == 0.2
[1] FALSE

 options(digits=22)
 1-0.8
[1] 0.19999999999999996

 0.2
[1] 0.2

And because in this case R interprets (1-0.8) < 0.2, also
floor(40*(1*0.8)) is 7. ;-)


Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._