Detailed explanation of the value range of int long long under IOS
32bit:
unsigned int 0~4294967295 int -2147483648~2147483647 unsigned long andintSame long andintSame long longMaximum value of:9223372036854775807 long longMinimum value of:-9223372036854775808 unsigned long longMaximum value of:1844674407370955161 __int64Maximum value of:9223372036854775807 __int64Minimum value of:-9223372036854775808 unsigned __int64Maximum value of:18446744073709551615
64bit
unsigned int 0~4294967295 int -2147483648~2147483647 unsigned long and unsigned long longSame long andlong longSame long longMaximum value of:9223372036854775807 long longMinimum value of:-9223372036854775808 unsigned long longMaximum value of:1844674407370955161 __int64Maximum value of:9223372036854775807 __int64Minimum value of:-9223372036854775808 unsigned __int64Maximum value of:18446744073709551615
In the file:
#ifndef _OBJC_NSOBJCRUNTIME_H_ #define _OBJC_NSOBJCRUNTIME_H_ #include <> #include <objc/> #if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64 typedef long NSInteger; typedef unsigned long NSUInteger;//The value range of NSInteger under 64bit is long==long long#else typedef int NSInteger; typedef unsigned int NSUInteger;//The value range of NSInteger under 32bit is int==long#endif #define NSIntegerMax LONG_MAX #define NSIntegerMin LONG_MIN #define NSUIntegerMax ULONG_MAX #define NSINTEGER_DEFINED 1 #endif
Thank you for reading, I hope it can help you. Thank you for your support for this site!