Skip to content

Commit c5d4ae6

Browse files
committed
Check that division by zero in fastmath doesn't throw
1 parent 8f2b0e7 commit c5d4ae6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/fastmath.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ fm_fast_64_upd(x) = @fastmath (r=x; r+=eps64_2; r+=eps64_2)
6060
@test @fastmath(cmp(two,two)) == cmp(two,two)
6161
@test @fastmath(cmp(two,three)) == cmp(two,three)
6262
@test @fastmath(cmp(three,two)) == cmp(three,two)
63-
@test @fastmath(one/zero) == convert(T,Inf)
64-
@test @fastmath(-one/zero) == -convert(T,Inf)
63+
@test @fastmath(one/zero) isa T # must not throw
64+
@test @fastmath(-one/zero) isa T # must not throw
6565
@test isnan(@fastmath(zero/zero)) # must not throw
6666

6767
for x in (zero, two, convert(T, Inf), convert(T, NaN))

0 commit comments

Comments
 (0)