Skip to content

Commit ea54f78

Browse files
committed
add test
1 parent 59010a3 commit ea54f78

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/concrete_accuracy.jl

+14
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,17 @@
4646
@test typeof(rand(Double32)) == Double32
4747
@test typeof(rand(Double16)) == Double16
4848
end
49+
50+
@testset "Subnormal numbers" begin
51+
for (F, D) in (
52+
(Float64, Double64),
53+
(Float32, Double32),
54+
(Float16, Double16),
55+
)
56+
sn = D(prevfloat(floatmin(F)) / 10)
57+
58+
@test issubnormal(sn)
59+
@test sqrt(F(sn)) == F(sqrt(D(sn)))
60+
@test cbrt(F(sn)) == F(cbrt(D(sn)))
61+
end
62+
end

0 commit comments

Comments
 (0)