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

2006-09-20 Thread Charles C. Berry
On Tue, 19 Sep 2006, Johannes H?sing wrote: Peter Dalgaard: Ben Bolker [EMAIL PROTECTED] writes: 1. compose your response I've always wondered why step 1. - often the time-consuming bit - is not listed last. The advice applies to the situation when answering immediately would be

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

2006-09-19 Thread Johannes Hüsing
Peter Dalgaard: Ben Bolker [EMAIL PROTECTED] writes: 1. compose your response I've always wondered why step 1. - often the time-consuming bit - is not listed last. The advice applies to the situation when answering immediately would be your knee-jerk reaction. It is assumed that

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

2006-09-18 Thread Iñaki Murillo Arcos
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

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

2006-09-18 Thread Marc Schwartz (via MN)
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

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

2006-09-18 Thread David Barron
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

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

2006-09-18 Thread Charles Annis, P.E.
] [mailto:[EMAIL PROTECTED] On Behalf Of Iñaki Murillo Arcos Sent: Monday, September 18, 2006 1:32 PM To: r-help@stat.math.ethz.ch Subject: [R] acos(0.5) == pi/3 FALSE 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

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

2006-09-18 Thread Peter Dalgaard
Iñaki Murillo Arcos [EMAIL PROTECTED] writes: Hello, I don't know if the result of acos(0.5) == pi/3 is a bug or not. It looks strange to me. Have a look in the R FAQ: acos(0.5) - pi/3 [1] 2.220446e-16 -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B

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

2006-09-18 Thread Douglas Bates
On 9/18/06, Iñaki Murillo Arcos [EMAIL PROTECTED] 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

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

2006-09-18 Thread David Forrest
On Mon, 18 Sep 2006, [iso-8859-1] 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. Real numbers are strange. Would the result of: acos(0.5) - pi/3 close enough to zero for you? Try help('Comparison') ,

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

2006-09-18 Thread Sundar Dorai-Raj
Iñaki Murillo Arcos said the following on 9/18/2006 12:31 PM: 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

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

2006-09-18 Thread Ted Harding
On 18-Sep-06 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 It is not a bug, but a feature, in that acos(0.5) and pi/3 are not computed in the same way, so (because of the small

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

2006-09-18 Thread Ben Bolker
Time for folks to re-read the posting guide? * When responding to a very simple question, use the following algorithm: 1. compose your response 2. type 4*runif(1) at the R prompt, and wait this many hours 3. check for new posts to R-help; if no similar

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

2006-09-18 Thread Peter Dalgaard
Ben Bolker [EMAIL PROTECTED] writes: Time for folks to re-read the posting guide? * When responding to a very simple question, use the following algorithm: 1. compose your response 2. type 4*runif(1) at the R prompt, and wait this many hours 3. check for