diff --git a/array_api_tests/test_operators_and_elementwise_functions.py b/array_api_tests/test_operators_and_elementwise_functions.py index 785d3665..f14c7585 100644 --- a/array_api_tests/test_operators_and_elementwise_functions.py +++ b/array_api_tests/test_operators_and_elementwise_functions.py @@ -72,9 +72,9 @@ def isclose_complex( if cmath.isnan(a) or cmath.isnan(b): raise ValueError(f"{a=} and {b=}, but input must be non-NaN") if cmath.isinf(a): - return cmath.isinf(b) or abs(b) > cmath.log(maximum) + return cmath.isinf(b) or abs(b) > 2**(math.log2(maximum)//2) elif cmath.isinf(b): - return cmath.isinf(a) or abs(a) > cmath.log(maximum) + return cmath.isinf(a) or abs(a) > 2**(math.log2(maximum)//2) return cmath.isclose(a, b, rel_tol=rel_tol, abs_tol=abs_tol)