@@ -103,8 +103,8 @@ def test_array_aminmax(op, a, b):
103103 np .testing .assert_array_equal (np .array (quad_res ).astype (float ), float_res )
104104
105105
106- @pytest .mark .parametrize ("op" , ["negative" , "positive" , "absolute" , "sign" , "signbit" , "isfinite" , "isinf" , "isnan" ])
107- @pytest .mark .parametrize ("val" , ["3.0" , "-3.0" , "12.5" , "100.0" , "0.0" , "-0.0" , "inf" , "-inf" , "nan" , "-nan" ])
106+ @pytest .mark .parametrize ("op" , ["negative" , "positive" , "absolute" , "sign" , "signbit" , "isfinite" , "isinf" , "isnan" , "sqrt" , "square" , "reciprocal" ])
107+ @pytest .mark .parametrize ("val" , ["3.0" , "-3.0" , "12.5" , "100.0" , "1e100" , " 0.0" , "-0.0" , "inf" , "-inf" , "nan" , "-nan" ])
108108def test_unary_ops (op , val ):
109109 op_func = dict (negative = operator .neg , positive = operator .pos , absolute = operator .abs ).get (op , None )
110110 nop_func = getattr (np , op )
@@ -120,7 +120,9 @@ def test_unary_ops(op, val):
120120 float_result = of (float_val )
121121
122122 np .testing .assert_array_equal (np .array (quad_result ).astype (float ), float_result )
123- assert np .signbit (float_result ) == np .signbit (quad_result )
123+
124+ if op in ["negative" , "positive" , "absolute" , "sign" ]:
125+ assert np .signbit (float_result ) == np .signbit (quad_result )
124126
125127
126128def test_inf ():
0 commit comments