From bozhou1981 at hotmail.com  Sun Feb 17 21:50:13 2008
From: bozhou1981 at hotmail.com (bozhou1981 at hotmail.com)
Date: Sun, 17 Feb 2008 21:50:13 +0100 (CET)
Subject: [Rd]  Arithmetic bug? (found when use POSIXct) (PR#10776)
Message-ID: <20080217205013.9349E282EFF7@mail.pubhealth.ku.dk>


Hi Gabo,

FAQ 7.31 does not apply to this. "numeric" in R is 64bit which is large eno=
ugh to handle this.

I
figured out the cause is that Sys.time() gives millisecond value while
b<-as.POSIXct(format(a,tz=3D"GMT")) cuts off that part.=20

Then of course a-b is not 5 hours!

Do it again with "options(digits=3D22)" and you will see what actually happ=
ened there.

The recommended code from R News is not aware the truth that POSIXlt can re=
present sub-second time.

Cheers,

B
_________________________________________________________________
Helping your favorite cause is as easy as instant messaging.=A0You IM, we g=
ive.

	[[alternative HTML version deleted]]



[Rd] Arithmetic bug? (found when use POSIXct) (PR#10776)
bozhou1981 at hotmail.com