[Rd] floor and ceiling can't handle more than 15 decimal places (PR#8590)

From: <benphalan_at_gmail.com>
Date: Sun 12 Feb 2006 - 15:05:25 GMT


Full_Name: Ben Phalan
Version: 2.2.1
OS: Win XP
Submission from: (NULL) (131.111.111.231)

I have noticed that floor returns the wrong number when there are more than 15 decimal places:

> floor(6.999999999999999)

[1] 6
> floor(6.9999999999999999)

[1] 7

There is a similar problem with ceiling, so this may apply to all/most rounding functions?

> ceiling (2.000000000000001)

[1] 3
> ceiling (2.0000000000000001)

[1] 2



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon Feb 13 02:08:00 2006

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:41 GMT