Re: Overriding libSystem's math functions
Re: Overriding libSystem's math functions
- Subject: Re: Overriding libSystem's math functions
- From: Eric Albert <email@hidden>
- Date: Mon, 11 Dec 2006 13:26:17 -0800
On Dec 11, 2006, at 11:35 AM, Mike Blaguszewski wrote:
On Dec 11, 2006, at 2:17 PM, Greg Guerin wrote:
You could define macros for all the standard functions that call your
custom functions:
#define sin(x) foosin(x)
#define cos(x) foocos(x)
If you put those in your own local "foomath.h" header, then your code
#includes that file rather than <math.h>. Your source can still
be written
as if it used the standard functions sin(), cos(), etc.
I think this is the probably the way to I'm going to have to go, as
the MS Visual C++ linker is less forgiving. Though even then it
seems like higher-level optimizations could cause differences
between gcc and MSVC, despite forcing strict IEEE math.
I am not a math expert (or anything close to it), but I do know that
IEEE-754 compliance will not give you exactly the same floating point
results on all architectures. IEEE-754 guarantees floating point
equivalence up to a certain level of precision. If you want floating
point equality, you'll have to go with your own FP library that does
all of its work outside of the hardware FP unit.
-Eric
_______________________________________________
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