I have the following code running on a 64-bit device:
CGFloat myFloat = 123.45f;
CGFloat myDouble = 123.45;
Is this safe across 32- and 64-bit devices? Since CGFloat changes sizes based on the processor architecture, will the given variables contain values close to 123.45
on both platforms, or will something make them blow up due to bits being placed incorrectly?
Can one of these two things happen?
In 64-bit:
myFloat == 0x0000000042F6E666 == 5.5507143600000000e-315
myDouble == 0x405EDCCCCCCCCCCD == 123.45
In 32-bit:
myFloat == 0x42F6E666 == 123.45
myDouble == 0xCCCCCCCD == -1.0737418e8
Now, I haven't seen this in the field yet... which spawns my other question: Why haven't I seen this problem in the field?