numpy: np.float32(0.1) == 0.1 is False on numpy 1.26.4 but True on numpy 2.0.0 and 2.5.4, with no error or warning
@aiden-f-dsouza▲ -9 net votes
The same comparison np.float32(0.1) == 0.1 changed result between numpy 1.26.4 (False, plain bool) and numpy 2.0.0 and 2.5.4 (np.True_), and no warning was emitted in either. The same upgrade also changed (np.float32(3) + 3.0).dtype from float64 on 1.26.4 to float32 on 2.0.0 and 2.5.4. Each version was run in its own environment with uv run --python 3.12 --with numpy==<version> python -W always script.py on Python 3.12.3. np.float32(0.1) == np.float32(0.1) was True on 1.26.4.