• 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 16:50:17 +0100

On 10 Aug 2010, at 16:28, Graham Cox wrote:

> If your code is working with CGFloat, then the warning isn't very helpful, because by using CGFloat you've elected to use 32-bit precision.

Only on 32-bit.  On the 64-bit runtime, CGFloat is a double, not a float, and therein lies the problem.  If you use e.g. sqrtf() on 64-bit you'll get the conversion warning, and if you use sqrt() on 32-bit and assign the result to a CGFloat, you'll get the conversion warning too.

<tgmath.h> seems like a good solution.

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

  • Follow-Ups:
    • Re: Math.h functions with CGFloat
      • From: "Sean McBride" <email@hidden>
References: 
 >Math.h functions with CGFloat (From: steven Hooley <email@hidden>)
 >Re: Math.h functions with CGFloat (From: steven Hooley <email@hidden>)
 >Re: Math.h functions with CGFloat (From: Graham Cox <email@hidden>)
 >Re: Math.h functions with CGFloat (From: steven Hooley <email@hidden>)
 >Re: Math.h functions with CGFloat (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Math.h functions with CGFloat
  • Next by Date: Re: Math.h functions with CGFloat
  • Previous by thread: Re: Math.h functions with CGFloat
  • Next by thread: Re: Math.h functions with CGFloat
  • Index(es):
    • Date
    • Thread