[R] number precision
murdoch at stats.uwo.ca
Sun Aug 19 00:29:19 CEST 2007
pieterprovoost at gmail.com wrote:
> I'm trying to find a way to determine how many digits a number has. I tried using nchar(paste(number)), but unfortunately paste will reduce 8.00 to "8".
I think your problem is that "the number of digits a number has" is not
a property of the number (since the numbers 8.00 and 8 are the same
number). You need to keep track of the digits in some other way. One
possibility is to store two numbers: the lowest possible value and the
highest possible value. Then 8.00 would be stored as (7.995, 8.005).
It's then possible (but not easy) to propagate these ranges through
> Any thoughts?
> This message was sent on behalf of pieterprovoost at gmail.com at openSubscriber.com
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help