[R] Help for numbers close to 1 in R

Liviu Andronic landronimirc at gmail.com
Sat Feb 13 16:34:20 CET 2010


On Sat, Feb 13, 2010 at 2:17 PM, cjmr <cjregunay at gmail.com> wrote:
>>p=1e-49
>>1+p
> [1] 1
>

Try this:
> source("http://r-bc.googlecode.com/svn/trunk/R/bc.R")
> p <- bc(1e-49)
> p
[1] ".0000000000000000000000000000000000000000000000001"
> 1+p
[1] "1.0000000000000000000000000000000000000000000000001"

You might want to check this [1] and search the archives for "precision".
Liviu

[1] http://code.google.com/p/r-bc/


> My problem comes from some values of x for the value:
>    1-exp(-sum((x-1/sqrt(3))^2))
> the return values are always equivalent.
>
> Please help
> Thanks
> --
> View this message in context: http://n4.nabble.com/Help-for-numbers-close-to-1-in-R-tp1554416p1554416.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail



More information about the R-help mailing list