• 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: Graham Cox <email@hidden>
  • Date: Wed, 11 Aug 2010 01:28:29 +1000

On 11/08/2010, at 1:08 AM, steven Hooley wrote:

> But then e.g. when building 32-bit i still have to cast the return
> value or i get the warning:-
>
> 'implicit conversion shortens 64-bit value into a 32-bit value'
>
> It seems that this warning is my fault because i have added the flag
> -Wshorten-64-to-32 which isn't enabled by default so maybe it
> shouldn't be?


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. If you want 'double', use 'double'. The warning could be useful on 64-bit compiles to indicate the inadvertent use of 'float' where you meant 'double' or 'CGFloat', but if you're only using CGFloat then that won't happen.

--Graham


_______________________________________________

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: Alastair Houghton <email@hidden>
    • Re: Math.h functions with CGFloat
      • From: Kyle Sluder <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>)

  • 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