octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test failure for mappers.cc


From: Ben Abbott
Subject: Re: test failure for mappers.cc
Date: Wed, 10 Nov 2010 20:04:56 +0800

On Nov 10, 2010, at 7:48 PM, Jarno Rajahalme wrote:

> On Nov 10, 2010, at 9:17 , ext Ben Abbott wrote:
> 
>> 
>> I get the following
>> 
>> M_PI = 3.141592741012573
>> (float) M_PI = 3.1415927 (0x40490fdb)
>> atan2f (0.0f, -1.0f) = 3.14159250 (0x40490fda)
>> atan2f (0.0f, -1.0f) - (float) M_PI = -0.00000024 (0xb4800000)
>> 
>> Looking through Apple's sources, I don't see a atan2f.c. But I do see 
>> atan2f.s ...
>> 
>>      
>> http://www.opensource.apple.com/source/Libm/Libm-315/Source/Intel/atan2f.s
> 
> Looking at that code, it seems it is working as specified. Note:
> 
> "Return a value in [-pi, +pi] (C 7.12.4.4 3).  Note that this
> prohibits returning correctly rounded values for -pi and +pi, since
> pi rounded to a float lies outside that interval."
> 
> On octave, I get:
> 
> octave:5> pi - double(single(pi))
> ans = -8.7423e-08
> 
> which shows that pi rounded to a single actually is larger than pi as a 
> double, and therefore outside of the range [-pi, pi].
> 
> Regards,
> 
>  Jarno

ok. Perhaps this qualifies as an unintended feature?

Is there something that can be done to correct this behavior?

Ben
                



reply via email to

[Prev in Thread] Current Thread [Next in Thread]