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

Douglas Bates bates at stat.wisc.edu
Mon Sep 18 23:13:17 CEST 2006


On 9/18/06, Iñaki Murillo Arcos <inaki.murillo at ehu.es> 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.

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.



More information about the R-help mailing list