Skip to content

Commit 440094c

Browse files
committed
Fix underflow exception in test_logaddexp
1 parent 9fce298 commit 440094c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

array_api_tests/test_operators_and_elementwise_functions.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,10 @@ def test_log10(x):
14061406

14071407

14081408
def logaddexp_refimpl(l: float, r: float) -> float:
1409-
return math.log(math.exp(l) + math.exp(r))
1409+
try:
1410+
return math.log(math.exp(l) + math.exp(r))
1411+
except ValueError: # raised for log(0.)
1412+
raise OverflowError
14101413

14111414

14121415
@given(*hh.two_mutual_arrays(dh.real_float_dtypes))

0 commit comments

Comments
 (0)