Hi All,
I recently encountered results that I did not expect, exhibited by the following code snippet:
test <- function() {
minX <- 4.2
min0 <- 4.1
sigmaG <- 0.1
Diff <- minX-min0
print(c(Diff=Diff,sigmaG=sigmaG))
cat("is Diff > sigmaG?:", Diff > sigmaG,"\n")
cat("is (4.2 - 4.1) > 0.1?:",(4.2 - 4.1) > 0.1,"\n")
cat("is 0.1 > 0.1?:", 0.1>0.1,"\n")
When I execute the above function I get the following:
> test()
Diff sigmaG
0.1 0.1
is Diff > sigmaG?: TRUE
is (4.2 - 4.1) > 0.1?: TRUE
is 0.1 > 0.1?: FALSE
Can someone please help me understand why R returns TRUE for (4.2 - 4.1) > 0.1 ?
Thanks so much,
Chris
I'm running the precompiled R-2.2.0 binary for Windows on WinXP Pro SP1.
>Sys.getlocale()
"LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252"
>version
_
platform i386-pc-mingw32
arch i386 os mingw32
This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:54 EST