详解 IOS下int long longlong的取值范围
详解IOS下intlonglonglong的取值范围
32bit下:
unsignedint0~4294967295 int-2147483648~2147483647 unsignedlong和int一样 long和int一样 longlong的最大值:9223372036854775807 longlong的最小值:-9223372036854775808 unsignedlonglong的最大值:1844674407370955161 __int64的最大值:9223372036854775807 __int64的最小值:-9223372036854775808 unsigned__int64的最大值:18446744073709551615
64bit下
unsignedint0~4294967295 int-2147483648~2147483647 unsignedlong和unsignedlonglong一样 long和longlong一样 longlong的最大值:9223372036854775807 longlong的最小值:-9223372036854775808 unsignedlonglong的最大值:1844674407370955161 __int64的最大值:9223372036854775807 __int64的最小值:-9223372036854775808 unsigned__int64的最大值:18446744073709551615
NSObjCRuntime.h文件中:
#ifndef_OBJC_NSOBJCRUNTIME_H_ #define_OBJC_NSOBJCRUNTIME_H_ #include#include #if__LP64__||(TARGET_OS_EMBEDDED&&!TARGET_OS_IPHONE)||TARGET_OS_WIN32||NS_BUILD_32_LIKE_64 typedeflongNSInteger; typedefunsignedlongNSUInteger;//64bit下NSInteger的取值范围就是long==longlong #else typedefintNSInteger; typedefunsignedintNSUInteger;//32bit下NSInteger的取值范围就是int==long #endif #defineNSIntegerMaxLONG_MAX #defineNSIntegerMinLONG_MIN #defineNSUIntegerMaxULONG_MAX #defineNSINTEGER_DEFINED1 #endif
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!