• 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: Math.h functions with CGFloat
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Math.h functions with CGFloat


  • Subject: Re: Math.h functions with CGFloat
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 10 Aug 2010 14:54:51 +0100

On 10 Aug 2010, at 13:42, steven Hooley wrote:

> Is there a preferred way to use the Math.h functions with CGFloats
> that is 32 and 64 bit safe?

Why would they be unsafe?  (They aren't.)

It's possible that using the double versions (the ones without the "f" suffix) is inefficient in 32-bit mode, but in practice you're very unlikely to notice.  If you particularly cared, you could #define some macros for them, but I doubt it's worthwhile unless you're going to do some heavy-duty geometry (and in that case, you might find that you want to use double anyway, for accuracy).

BTW, <math.h> isn't capitalised; please don't use random upper-case letters when including header files... it causes grief if your source code is ever moved somewhere case-sensitive.

> Should i even be using Math.h functions in Cocoa?

Why should you not?

Kind regards,

Alastair.

--
http://alastairs-place.net




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Math.h functions with CGFloat (From: steven Hooley <email@hidden>)

  • Prev by Date: Re: calling a function in one class from another
  • Next by Date: Re: Custom zones...
  • Previous by thread: Math.h functions with CGFloat
  • Next by thread: Fwd: Math.h functions with CGFloat
  • Index(es):
    • Date
    • Thread