Re: Overriding libSystem's math functions
Re: Overriding libSystem's math functions
- Subject: Re: Overriding libSystem's math functions
- From: Greg Guerin <email@hidden>
- Date: Mon, 11 Dec 2006 12:17:01 -0700
Mike Blaguszewski wrote:
>In an attempt to get identical floating point results across platforms ...
A simple question: Why?
The longer version of the question:
What do you intend to achieve by doing this? At what cost?
>... Currently I'm compiling these files directly into my project, and
>#including the system <math.h> header. This seems to work, but gives me a
>bunch of linker warnings about multiple definitions for sin, cos, etc.. Is
>this a reliable thing to be doing? Is there some better way to override
>functions in libSystem? Worst case, I can rename the custom functions and
>their calls, but I was hoping to avoid that.
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.
>Thanks for any assistance, and if you think my end goal is hopeless, feel
>free to advise on that too :-)
We don't know your end goal, only that you've chosen to use identical fp
results across platforms as the technical means to achieve it. That is, we
know the What you've chosen, but we don't know the Why.
-- 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