Skip to content

Commit bcd5919

Browse files
authored
Merge pull request #294 from asmeurer/fix-elementwise-ignoring-exceptions
More fixes to elementwise functions
2 parents 4b36767 + d1176f5 commit bcd5919

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: array_api_tests/test_operators_and_elementwise_functions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def isclose_complex(
7272
if cmath.isnan(a) or cmath.isnan(b):
7373
raise ValueError(f"{a=} and {b=}, but input must be non-NaN")
7474
if cmath.isinf(a):
75-
return cmath.isinf(b) or abs(b) > cmath.log(maximum)
75+
return cmath.isinf(b) or abs(b) > 2**(math.log2(maximum)//2)
7676
elif cmath.isinf(b):
77-
return cmath.isinf(a) or abs(a) > cmath.log(maximum)
77+
return cmath.isinf(a) or abs(a) > 2**(math.log2(maximum)//2)
7878
return cmath.isclose(a, b, rel_tol=rel_tol, abs_tol=abs_tol)
7979

8080

0 commit comments

Comments
 (0)