Skip to content

Commit a37942e

Browse files
authored
add tests
1 parent ebb46da commit a37942e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/specialvalues.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ end
3333
@test isnan(LO(T(NaN)))
3434
end
3535

36+
@testset "Inf and NaN conversion" for T in (Double16, Double32, Double64)
37+
for S in (BigFloat, Float128)
38+
@test isnan(S(T(NaN)))
39+
@test isinf(S(T(Inf)))
40+
@test S(T(Inf)) > 0
41+
@test isinf(S(T(-Inf)))
42+
@test S(T(-Inf)) < 0
43+
@test isnan(T(S(NaN)))
44+
@test isinf(T(S(Inf)))
45+
@test T(S(Inf)) > 0
46+
@test isinf(T(S(-Inf)))
47+
@test T(S(-Inf)) < 0
48+
end
49+
end
50+
3651
@testset "NaNs $T" for T in (Double16, Double32, Double64)
3752
@test isnan(exp(T(NaN)))
3853
@test isnan(log(T(NaN)))

0 commit comments

Comments
 (0)