Skip to content

Commit

Permalink
add tests for printing subnormals
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Oct 16, 2019
1 parent a950f82 commit b6f5258
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/ryu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ end
@test Ryu.writeexp(1e-63, 0) == "1e-63"
@test Ryu.writeexp(1e-63, 1) == "1.0e-63"
@test Ryu.writeexp(1e+83, 0) == "1e+83"
@test Ryu.writeexp(1e+83, 1) == "1.0e+83"
324 @test Ryu.writeexp(1e+83, 1) == "1.0e+83"
end

end # exp
Expand All @@ -758,6 +758,11 @@ end # exp
@test stringcompact(1.015625) == "1.01562"
@test stringcompact(1.046875) == "1.04688"
@test stringcompact(0.025621074) == "0.0256211"

# subnormals
@test stringcompact(eps(0.0)) == "5.0e-324"
@test stringcompact(eps(0f0)) == "1.0f-45"
@test stringcompact(eps(Float16(0.0))) == "6.0e-8"
end

end # Ryu

0 comments on commit b6f5258

Please sign in to comment.