Re: sinf(), cosf() et al
Re: sinf(), cosf() et al
- Subject: Re: sinf(), cosf() et al
- From: Wade Tregaskis <email@hidden>
- Date: Tue, 22 Oct 2002 22:10:49 +1000
I suspect it doesn't exist.
Is there any difference on PPC between using double and float, ie cos
and
cosf?
That's pretty much it. If memory serves, the PPC family only performs
FP operations on doubles anyway, so there's no point, really, in
worrying about floats. But if my memory's as bad as normal, I might be
wrong. :)
Whatever the reason, there's no performance advantage using floats over
doubles (other than maybe memory use), and as such there's not much
bother with float-specific versions of functions. If you're writing
Mac specific code, don't use float, as I think you do lose some
performance with the invariable type conversions.
A side effect of this double-only setup is that even if you just want a
float-precision cos/sin/etc, you get double. This does incur a
significant speed loss for many functions (don't know about trig ones
specifically). You can get around this by doing your own trig
functions in assembly, which gives you the freedom to choose however
many levels of refinement - and therefore precision - you need.
Wade Tregaskis
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.