[Rd] Numerical error in R (win32) (PR#8909)
teck.lim at imperial.ac.uk
Tue May 30 14:42:13 CEST 2006
Thanks for the quick reply. However, I am not satisfied, as
> round(3.15000000, 1)
> round(3.75000000, 1)
I think the problem is really more of an error in the rounding off
algorithm than finite precision.
From: Peter Ehlers [mailto:ehlers at math.ucalgary.ca]
Sent: Monday, May 29, 2006 17:45
To: teck.lim at imperial.ac.uk
Cc: r-devel at stat.math.ethz.ch
Subject: Re: [Rd] Numerical error in R (win32) (PR#8909)
Did you check the Details section of the help page for round()?
teck.lim at imperial.ac.uk wrote:
> I had observed the following problem in R (also C, Matlab, and
> sprintf('%1.2g\n', 3.15)
> give 3.1 instead of 3.2 whereas an input of 3.75 gives 3.8.
> Java's System.out.printf is ok though.
>  3.8
>  3.1
> Similar outcome with sprintf in R.
> However, the right answer should be 3.2
> [[alternative HTML version deleted]]
> R-devel at r-project.org mailing list
More information about the R-devel