Re: problem with cos ( pi/2 )
Re: problem with cos ( pi/2 )
- Subject: Re: problem with cos ( pi/2 )
- From: Greg Guerin <email@hidden>
- Date: Fri, 16 Jun 2006 11:00:03 -0700
billmonk wrote:
>cos( M_PI_2 ); // pi/2, 1.57079632679489661923 from <math.h>
>
>My old IM:PowerPC Numeric book, and the OS X pdf here
>
>http://developer.apple.com/documentation/Performance/Conceptual/
>Mac_OSX_Numerics/Mac_OSX_Numerics.pdf
I think the correct include-file for the cited reference is <fp.h>, not
<math.h>. I wouldn't assume that <math.h>'s cos() exhibits precisely the
same behavior as the CoreServices math-library's cos().
Also, <fp.h> declares 'extern double_t const pi', while <math.h> #defines
literal constants for M_PI, M_PI_2, etc. I wouldn't assume that 'pi' and
M_PI are necessarily equal, considering their different origins and
representations.
IIRC, the magnitude of the error you're seeing is approximately 1 lsb,
which makes me wonder about rounding mode.
I don't know if any of this is the root of the problem or not, but I think
it adds around 6.123e-17 of doubt.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden