[swift-evolution] Thoughts on clarity of Double and Float type names?

Chris Lattner clattner at apple.com
Wed Jan 6 12:44:08 CST 2016


> On Jan 6, 2016, at 12:01 AM, Goffredo Marocchi <panajev at gmail.com> wrote:
> 
> Hello Chris,
> 
> When dealing with floating point values, wouldn't it be in our best interest to always be very specific about the accuracy of the floating point type variables we use regardless of the device it runs on? This is the biggest problem I had with CGFloat: while it is nice at first to have a type that adapts to the device word size it runs on, I prefer to always have an explicit accuracy guarantee than worrying about my CGFloat code changing in behaviour when it runs on a 32 bit device rather than a 64 bit one.

There are lots of things that are unfortunate about CGFloat.  I don’t see how they translate to Float and Double.

-Chris


More information about the swift-evolution mailing list