Numpy float64 vs Python float

>>> numpy.float64(5.9975).hex()
'0x1.7fd70a3d70a3dp+2'
>>> (5.9975).hex()
'0x1.7fd70a3d70a3dp+2'

They are the same number. What differs is their representation; the Python native type uses a “sane” representation, and the NumPy type uses an accurate representation.

Leave a Comment

tech