Closed apivovarov closed 2 months ago
Hi - thanks for the report! It looks like that output comes from this line: https://github.com/jax-ml/ml_dtypes/blob/30f2497888b90db1c9f775ed1279315acdf44f30/ml_dtypes/_src/ufuncs.h#L171
We probably need to update this to condition the returned value on the value of a
.
I think it should return {-inf, nan}
if a < 0
, {nan, nan}
if a == 0
, and {inf, nan}
if a > 0
.
Thanks again for the report! We'll try to cut a new release soon with this fix. Let us know if you run into other issues
If the second argument of
np.floor_divide
is 0.0, it returns different results depending on the type: np.dtypes returns Inf, while ml_dtypes returns NaNRelated test: ml_dtypes/tests/custom_float_test.py testBinaryUfunc. The test fails if y has 0.0 elements.
Manual run to confirm the difference in behavior