Hi
Thanks for the quick reply. However, I am not satisfied, as
> round(3.1500, 1)
[1] 3.1
> round(3.7500, 1)
[1] 3.8
I think the problem is really more of an error in the rounding off
algorithm than finite precision.
Thanks
Teckpor
-Original Message-
From: Uwe L
Hi
I had observed the following problem in R (also C, Matlab, and Python).
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.
> round(3.75,1)
[1] 3.8
> round(3.15,1)
[1] 3.1
Similar outcome with sprintf in R.
Howev