Displaying 1 result from an estimated 1 matches for "deciml".
Did you mean:
decimal
2005 May 22
3
comparison operator, decimals, and signif()
...ime trouble
shooting a function that I had written only to
discover that the problem I was having was with the
comparison operator. I assumed that the following
would return TRUE:
> testMean <- 82.8 + 0.1
> testMean
[1] 82.9
> testMean == 82.9
[1] FALSE
Apparently this has to do with deciml places. Look:
> newTest <- 82.0
> newTest
[1] 82
> newTest == 82
[1] TRUE
> newTest == 82.0
[1] TRUE
>
What does signif() do to my object called "testMean"
so that the comparison now evaluates to TRUE?
> signif(testMean, 3) == 82.9
[1] TRUE
Version info:
> R...