📜  numpy.iinfo()函数– Python

📅  最后修改于: 2022-05-13 01:55:30.959000             🧑  作者: Mango

numpy.iinfo()函数– Python

numpy.iinfo()函数显示整数类型的机器限制。

代码#1:

# Python program explaining
# numpy.iinfo() function
           
# importing numpy as geek 
import numpy as geek 
       
gfg = geek.iinfo(geek.int16)
     
print (gfg)

输出 :

Machine parameters for int16
---------------------------------------------------------------
min = -32768
max = 32767
---------------------------------------------------------------


代码#2:

# Python program explaining
# numpy.iinfo() function
           
# importing numpy as geek 
import numpy as geek 
       
gfg = geek.iinfo(geek.int32)
     
print (gfg)

输出 :

Machine parameters for int32
---------------------------------------------------------------
min = -2147483648
max = 2147483647
---------------------------------------------------------------