Skip to content

Help for numbers close to 1 in R

3 messages · cjmr, Liviu Andronic, Gabor Grothendieck

#
Hi all.

I have a problem with adding 1 and very small numbers

ex:
[1] 1

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
#
On Sat, Feb 13, 2010 at 2:17 PM, cjmr <cjregunay at gmail.com> wrote:
Try this:
[1] ".0000000000000000000000000000000000000000000000001"
[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/

  
    
  
#
Check out ?expm1
On Sat, Feb 13, 2010 at 9:17 AM, cjmr <cjregunay at gmail.com> wrote: