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

From: David Barron <mothsailor_at_googlemail.com>
Date: Mon 18 Sep 2006 - 21:08:18 GMT

If you had looked at help("==") you would have seen the following:

For numerical and complex values, remember == and != do not allow for the finite representation of fractions, nor for rounding error. Using all.equal with identical is almost always preferable.

Then if you had tried

> all.equal(acos(0.5),pi/3)

[1] TRUE On 18/09/06, Iņaki Murillo Arcos <inaki.murillo@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.
>
> Inaki Murillo
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>

-- 
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

______________________________________________
R-help@stat.math.ethz.ch 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.
Received on Tue Sep 19 07:45:47 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 18 Sep 2006 - 22:30:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.