[swift-evolution] Thoughts on clarity of Double and Float type names?
Stephen Canon
scanon at apple.com
Wed Jan 6 10:05:36 CST 2016
> On Jan 6, 2016, at 3:01 AM, Goffredo Marocchi via swift-evolution <swift-evolution at swift.org> wrote:
>
> 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.
It’s worth noting that the definition of CGFloat is basically a historical curiosity. If we were starting from scratch today, CGFloat would be Double on all platforms, 32- and 64-bit. The 64-bit transition simply allowed for the ABI-breaking change of making it 64-bit to happen. There was never any desire or reason to have it match word size.
– Steve
More information about the swift-evolution
mailing list