numpy.finfo() function – Python (original) (raw)
Last Updated : 18 Jun, 2020
numpy.finfo()
function shows machine limits for floating point types.
Syntax : numpy.finfo(dtype)Parameters : dtype : [float, dtype, or instance] Kind of floating point data-type about which to get information.Return : Machine parameters for floating point types.
Code #1 :
Python3 `
Python program explaining
numpy.finfo() function
importing numpy as geek
import numpy as geek
gfg = geek.finfo(geek.float32)
print (gfg)
`
Output :
Machine parameters for float32
precision = 6 resolution = 1.0000000e-06 machep = -23 eps = 1.1920929e-07 negep = -24 epsneg = 5.9604645e-08 minexp = -126 tiny = 1.1754944e-38 maxexp = 128 max = 3.4028235e+38 nexp = 8 min = -max
Code #2 :
Python3 `
Python program explaining
numpy.finfo() function
importing numpy as geek
import numpy as geek
gfg = geek.finfo(geek.float64)
print (gfg)
`
Output :