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

Douglas Bates

2006-09-18

Replies:

On 9/18/06, Iñaki Murillo Arcos <inaki.murillo@(protected):
> Hello,
>
>  I don't know if the result of
>
>  acos(0.5) == pi/3
>
> is a bug or not. It looks strange to me.

However,

> all.equal(acos(0.5), pi/3)
[1] TRUE

so you may want to check the FAQ entry on comparisons involving
floating point numbers.

______________________________________________
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.