2 ms·
Very much this. Using floating-point types that have different sizes on different platforms without detailed analysis of the algorithm is a recipe for hard-to-
by stephencanon 14y ago
Very much this. Using floating-point types that have different sizes on different platforms without detailed analysis of the algorithm is a recipe for hard-to-diagnose bugs. Use float, or use double, whichever is most appropriate.
There are some subtle historical reasons why CGFloat is defined the way it is; a reasonable argument could be made that it "should have" been double on all platforms with 20/20 hindsight, but it can't be changed now without breaking binary compatibility.