Re: [R] Floating points and floor() ?

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Thu, 03 Mar 2011 21:33:43 -0600

On Mar 3, 2011, at 8:23 PM, Folkes, Michael wrote:

> Perhaps somebody could clarify for me if the following is a floating
> point matter or otherwise, and how am I to correct for it?
>
>> floor(100*.1)
> [1] 10
>
>> 100*(1.0-.9)
> [1] 10
>
>> floor(100*(1-0.9))
> [1] 9
>
>

Yes. It's a "floating point matter". What do you mean by "correct for it"? What result would be "correct"?

David Winsemius, MD
Heritage Laboratories
West Hartford, CT



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 04 Mar 2011 - 03:40:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Mar 2011 - 04:20:19 GMT.

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

list of date sections of archive