From vstolin at lordabbett.com  Wed Jan 12 20:22:04 2005
From: vstolin at lordabbett.com (vstolin@lordabbett.com)
Date: Wed Jan 12 20:22:11 2005
Subject: [Rd] Inaccuracy in seq() function (PR#7503)
Message-ID: <20050112192204.2F840EAE1@slim.kubism.ku.dk>

Full_Name: Vlad Stolin
Version: R 2.0.0
OS: Windows 2000
Submission from: (NULL) (204.128.232.211)


When generating the sequence using seq() function with non-integer numbers
result is somewhat unpredictable. Example:
> v1<-seq(1.60,1.90,.05)
> v2<-c(1.60,1.65,1.70,1.75,1.80,1.85,1.90)
> v1-v2
[1] 0.000000e+00 2.220446e-16 2.220446e-16 0.000000e+00 0.000000e+00
0.000000e+00 2.220446e-16
> v1==v2
[1]  TRUE FALSE FALSE  TRUE  TRUE  TRUE FALSE
> v1>1.70 & v2<1.80
[1] FALSE FALSE  TRUE  TRUE FALSE FALSE FALSE


[Rd] Inaccuracy in seq() function (PR#7503)
vstolin@lordabbett.com