详解 IOS下int long longlong的取值范围
程序员文章站
2023-12-21 12:37:22
详解 ios下int long longlong的取值范围
32bit下:
unsigned int 0~4294967295
int -214748364...
详解 ios下int long longlong的取值范围
32bit下:
unsigned int 0~4294967295 int -2147483648~2147483647 unsigned long 和int一样 long 和int一样 long long的最大值:9223372036854775807 long long的最小值:-9223372036854775808 unsigned long long的最大值:1844674407370955161 __int64的最大值:9223372036854775807 __int64的最小值:-9223372036854775808 unsigned __int64的最大值:18446744073709551615
64bit下
unsigned int 0~4294967295 int -2147483648~2147483647 unsigned long 和 unsigned long long一样 long 和long long一样 long long的最大值:9223372036854775807 long long的最小值:-9223372036854775808 unsigned long long的最大值:1844674407370955161 __int64的最大值:9223372036854775807 __int64的最小值:-9223372036854775808 unsigned __int64的最大值:18446744073709551615
nsobjcruntime.h文件中:
#ifndef _objc_nsobjcruntime_h_ #define _objc_nsobjcruntime_h_ #include <targetconditionals.h> #include <objc/objc.h> #if __lp64__ || (target_os_embedded && !target_os_iphone) || target_os_win32 || ns_build_32_like_64 typedef long nsinteger; typedef unsigned long nsuinteger;//64bit下nsinteger的取值范围就是long==long long #else typedef int nsinteger; typedef unsigned int nsuinteger;//32bit下nsinteger的取值范围就是int==long #endif #define nsintegermax long_max #define nsintegermin long_min #define nsuintegermax ulong_max #define nsinteger_defined 1 #endif
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!