IOS中int long longlong的取值范围是多少
更新:HHH   时间:2023-1-8


这篇文章主要介绍了IOS中int long longlong的取值范围是多少,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

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

感谢你能够认真阅读完这篇文章,希望小编分享的“IOS中int long longlong的取值范围是多少”这篇文章对大家有帮助,同时也希望大家多多支持天达云,关注天达云行业资讯频道,更多相关知识等着你来学习!

返回移动开发教程...