[Rd] significant digits (PR#9682)

Karl Ove Hufthammer Karl.Hufthammer at math.uib.no
Wed Jun 4 13:17:52 CEST 2008


Duncan Murdoch:

> The number 0.12345 is not exactly representable, but (I think) it is
> represented by something slightly closer to 0.1235 than to 0.1234.

I like using formatC for checking such things. On my (Linux) system, I get:

$ formatC(.12345,digits=50)
[1] "0.12345000000000000417443857259058859199285507202148"

> So it looks as though Windows gets it right.

-- 
Karl Ove Hufthammer



More information about the R-devel mailing list