[Rd] round() increases or decreases (PR#9195)

From: <gael.millot_at_curie.fr>
Date: Fri 01 Sep 2006 - 09:14:55 GMT


Full_Name: Gael Millot
Version: 2.3.1.
OS: XP
Submission from: (NULL) (195.220.102.23)

Hello.

I have a strange behavior with round() when it has to deal with 5. It sometimes rounds up, sometimes rounds down. Example :

coma effect :
> round(0.5,0)

[1] 0
> round(0.25,1)

[1] 0.2
> round(0.225,2)

[1] 0.23

Previous number effect :
> round(0.35,1)

[1] 0.3
> round(0.45,1)

[1] 0.5

It also happens with signif()

Is it normal ?
Many thanks.

Gael.



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat Sep 02 07:32:29 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 06 Sep 2006 - 11:39:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.