Re: [R] That dreaded floating point trap

From: Sarah Goslee <sarah.goslee_at_gmail.com>
Date: Thu, 31 Mar 2011 08:41:52 -0400

On Thu, Mar 31, 2011 at 8:14 AM, Alexander Engelhardt
> this helps, thank you.
> But if this code is in a function, and some user supplies a vector, I will
> still have to round it in the function, I guess.
>
> It's weird how 0.1 is different from round(0.1, digits=1) , but I don't want
> to read that 90 page long floating point paper which was referenced
> somewhere :)

Or you could try the much shorter R FAQ 7.31. Turns out it isn't weird at all, if you are a computer.

Sarah

-- 
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
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 Thu 31 Mar 2011 - 12:46:11 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 Thu 31 Mar 2011 - 13:00:26 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