Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

Re: [R] acos(0.5) == pi/3 FALSE

Marc Schwartz

2006-09-18

Replies:

On Mon, 2006-09-18 at 19:31 +0200, Iñaki Murillo Arcos wrote:
> Hello,
>
>  I don't know if the result of
>
>  acos(0.5) == pi/3
>
> is a bug or not. It looks strange to me.
>
>   Inaki Murillo

Seems reasonable to me:

> acos(0.5) == pi/3
[1] FALSE

> print(acos(0.5), 20)
[1] 1.0471975511965978534

> print(pi/3, 20)
[1] 1.0471975511965976313


See R FAQ 7.31 Why doesn't R think these numbers are equal?

HTH,

Marc Schwartz

______________________________________________
R-help@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.