[Numpy-discussion] float16/32: wrong number of digits?

Eric Wieser wieser.eric+numpy at gmail.com
Mon Mar 13 07:57:48 EDT 2017

> `float(repr(a)) == a` is guaranteed for Python `float`

And `np.float16(repr(a)) == a` is guaranteed for `np.float16`(and the same
is true up to `float128`, which can be platform-dependent). Your code
doesn't work because you're deserializing to a higher precision format than
you serialized to.

View this message in context: http://numpy-discussion.10968.n7.nabble.com/float16-32-wrong-number-of-digits-tp44037p44046.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.

More information about the NumPy-Discussion mailing list