3 ms·
CGFloat is a different type based on the system, is it not?
by Alphasite_ 11y ago
CGFloat is a different type based on the system, is it not?
- _jsn 11y agoYes. It's double precision on 64-bit platforms and single precision on 32-bit. #if defined(__LP64__) && __LP64__ # define CGFLOAT_TYPE double # define CGFLOAT_IS_DOUBLE 1 # define CGFLOAT_MIN DBL_MIN # define CGFLOAT_MAX DBL_MAX #else # define CGFLOAT_TYPE float # define CGFLOAT_IS_DOUBLE 0 # define CGFLOAT_MIN FLT_MIN # define CGFLOAT_MAX FLT_MAX #endif
- nadohs 11y agoExactly, this is also pointed out in the struct definition in CoreGraphics for CGFloat. /// The native type used to store the CGFloat, which is Float on 32-bit architectures and Double on 64-bit architectures.