You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The spec splits copysign behavior into x1_1 is not NaN cases and x1_i is NaN cases. The special cases parser doesn't handle this properly, leading to incorrect test case generation:
In [3]: import array_api_tests.test_special_cases as tsc
In [4]: copysign_cases = [p.values[-1] for p in tsc.binary_params if p.values[0] == "copysign"]
In [5]: copysign_cases
Out[5]:
[BinaryCase(<x2_i < 0 -> NaN>),
BinaryCase(<x2_i is -0 -> NaN>),
BinaryCase(<x2_i is +0 -> NaN>),
BinaryCase(<x2_i > 0 -> NaN>)]
In [6]: py_nan = float("nan")
In [7]: copysign_cases[0].check_result(1.0, -1.0, -1.0)
Out[7]: False
In [8]: copysign_cases[0].check_result(1.0, -1.0, py_nan)
Out[8]: True
In [9]: copysign_cases[1].check_result(1.0, -0.0, -1.0)
Out[9]: False
In [10]: copysign_cases[1].check_result(1.0, -0.0, py_nan)
Out[10]: True
In [11]: copysign_cases[2].check_result(-1.0, +0.0, 1.0)
Out[11]: False
In [12]: copysign_cases[2].check_result(-1.0, +0.0, py_nan)
Out[12]: True
In [13]: copysign_cases[3].check_result(-1.0, +1.0, 1.0)
Out[13]: False
In [14]: copysign_cases[3].check_result(-1.0, +1.0, py_nan)
Out[14]: True
The text was updated successfully, but these errors were encountered:
The spec splits
copysign
behavior intox1_1
is not NaN cases andx1_i
is NaN cases. The special cases parser doesn't handle this properly, leading to incorrect test case generation:The text was updated successfully, but these errors were encountered: