• 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: CGFloat and literal floats in Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGFloat and literal floats in Swift


  • Subject: Re: CGFloat and literal floats in Swift
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 26 Jul 2015 20:57:09 -0700

> On Jul 26, 2015, at 4:50 PM, Quincey Morris <email@hidden> wrote:
>
> No. Swift doesn’t convert between numeric types automatically, so Double —> CGFloat produces an error.

I’m guessing this is only a problem when building 32-bit? Because in 64-bit, CGFloat is equivalent to Double, so there shouldn’t be a problem there.

Rick: You could just define your own CGFloat constant equal to M_PI. (You could even name it π …!)

—Jens
_______________________________________________

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: CGFloat and literal floats in Swift
      • From: Rick Mann <email@hidden>
References: 
 >CGFloat and literal floats in Swift (From: Rick Mann <email@hidden>)
 >Re: CGFloat and literal floats in Swift (From: Quincey Morris <email@hidden>)
 >Re: CGFloat and literal floats in Swift (From: Rick Mann <email@hidden>)
 >Re: CGFloat and literal floats in Swift (From: Quincey Morris <email@hidden>)
 >Re: CGFloat and literal floats in Swift (From: Rick Mann <email@hidden>)
 >Re: CGFloat and literal floats in Swift (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: NSPropertyListSerialization weirdness
  • Next by Date: Re: CGFloat and literal floats in Swift
  • Previous by thread: Re: CGFloat and literal floats in Swift
  • Next by thread: Re: CGFloat and literal floats in Swift
  • Index(es):
    • Date
    • Thread