[R] odd behavior of numeric()

Scott Rifkin sarifkin at ucsd.edu
Wed Apr 27 21:29:13 CEST 2016


Why does:

 > numeric(0.2*25)

return

[1] 0 0 0 0 0

but

 > numeric((1-0.8)*25)

returns

[1] 0 0 0 0

[running version 3.2.0]


[Apologies if this has been asked before - it's a hard question to find 
specific search terms for]

Thanks,
Scott



More information about the R-help mailing list