整数最大值
sys.maxsize
An integer giving the maximum value a variable of type Py_ssize_t can take. It’s usually 231 - 1 on a 32-bit platform and 263 - 1 on a 64-bit platform.
最大值
在32位系统中 2147483647
在64位系统中 9223372036854775807
import sys
max_int = sys.maxsize
print(max_int)
输出
9223372036854775807
float最大值
max_float = float("inf") # 无限大 比所有数大
min_float = float("-inf") #无限小 比所有数小
print(type(max_float))
print(type(min_float))
<class 'float'>
<class 'float'>
-100000 > min_float # 所有数比无限小 大
True
10000000 < max_float # 所有数比无限大 小
True