Reputation: 8841
In some cases it can be important to select the correct floating point type for your application, and it seems that on ios/osx you are pushed in the direction of using CGFloat
.
CGFloat
is meant to be the native floating point type, but I can't find a good summary of which device is 32bit or 64bit (and I would worry that the head-line designation might be for the integer unit or the address bus which might be different from the FP unit).
Furthermore, I assume all of the hardware supports double FP anyway, albeit at lower performance than the native 64 bit units.
Presumably, the O/S is irrelevant as this applies only to the use of the address space (but correct me if I am wrong).
Upvotes: 1
Views: 91
Reputation: 9143
Support for the 64bit architecture was introduced for the first time in Apple's A7 chip, which means that the first device to support 64bit was the iPhone 5S. The first iOS version to support it was iOS 7.
That said, I don't really understand why does it matter which device/OS is it. Your code should just handle 32bit/64bit properly. CGFloat
is 4 bytes on 32bit systems and 8 bytes on 64bit systems, that's the only consideration.
Upvotes: 1