Displaying 1 result from an estimated 1 matches for "nextx".
Did you mean:
next
2010 Jan 07
7
Strange behaviour of as.integer()
I have encountered a strange behaviour of as.integer() which does not
seem correct to me. Sorry if this is just an indication of me not
understanding floating point arithmetic.
> .57 * 100
[1] 57
> .29 * 100
[1] 29
So far, so good. But:
> as.integer(.57 * 100)
[1] 56
> as.integer(.29 * 100)
[1] 28
Then again:
> all.equal(.57 * 100, as.integer(57))
[1] TRUE
> all.equal(.29 *