• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: sinf(), cosf() et al
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: sinf(), cosf() et al (From: Cameron Hayne <email@hidden>)

  • Prev by Date: Re: sinf(), cosf() et al
  • Next by Date: Re: Bridging (was Re: A CFStringRef that throws EXC_BAD_ACCESS)
  • Previous by thread: Re: sinf(), cosf() et al
  • Next by thread: Re: sinf(), cosf() et al
  • Index(es):
    • Date
    • Thread