When converting a number from half to single floating representation I see a change in the numeric value.
Here I have 65500
stored as a half precision float, but upgrading to single precision changes the underlying value to 65504
, which is many floating point increments away from the target.
In this specific case, why does this happen?
(Pdb) np.asarray(65500,dtype=np.float16).astype(np.float32)
array(65504., dtype=float32)
As a side note, I also observe
(Pdb) int(np.finfo(np.float16).max)
65504