@@ -107,7 +107,7 @@ def test_array_aminmax(op, a, b):
107107 assert np .all ((quad_res == float_res ) | ((quad_res != quad_res ) & (float_res != float_res )))
108108
109109
110- @pytest .mark .parametrize ("op,nop" , [("neg" , "negative" ), ("pos" , "positive" ), ("abs" , "absolute" ), (None , "sign" )])
110+ @pytest .mark .parametrize ("op,nop" , [("neg" , "negative" ), ("pos" , "positive" ), ("abs" , "absolute" ), (None , "sign" ), ( None , "signbit" ) ])
111111@pytest .mark .parametrize ("val" , ["3.0" , "-3.0" , "12.5" , "100.0" , "0.0" , "-0.0" , "inf" , "-inf" , "nan" , "-nan" ])
112112def test_unary_ops (op , nop , val ):
113113 op_func = None if op is None else getattr (operator , op )
@@ -124,11 +124,12 @@ def test_unary_ops(op, nop, val):
124124 float_result = op_func (float_val )
125125
126126 # FIXME: @juntyr: replace with array_equal once isnan is supported
127- # FIXME: @juntyr: also check the signbit once that is supported
128127 with np .errstate (invalid = "ignore" ):
129128 assert (
130129 (np .float64 (quad_result ) == float_result ) or
131130 ((float_result != float_result ) and (quad_result != quad_result ))
131+ ) and (
132+ np .signbit (float_result ) == np .signbit (quad_result )
132133 ), f"{ op } ({ val } ) should be { float_result } , but got { quad_result } "
133134
134135
0 commit comments