[R] rounding issues

Federico Calboli f.calboli at imperial.ac.uk
Thu Oct 14 11:43:53 CEST 2010


Hi All,

I'm running the now almost-to-be upgraded R 2.11.1 on a Intel Mac, and on a Ubuntu machine, but the problem I see is the same. I noticed the following behaviour:

407585.91 * 0.8 
[1] 326068.7  -- the right asnwer is 326068.728
round(407585.91 * 0.8, 2)
[1] 326068.7 -- same issue
407585.91/100
[1] 4075.859 -- the right answer is 4075.8591

I have no saved .Rwhatever in my environment, and I never set any option to have such strange rounding. I'm obviously missing something, and I'd appreciate suggestions.

Best,

Federico


--
Federico C. F. Calboli
Department of Epidemiology and Biostatistics
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG

Tel +44 (0)20 75941602   Fax +44 (0)20 75943193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com



More information about the R-help mailing list