Skip to content

Commit

Permalink
Tests for float conversions with many leading zeros (JuliaLang#30020)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored and StefanKarpinski committed Nov 29, 2018
1 parent 2b688c3 commit 3f8c311
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/numbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,11 @@ end
@test Float32(typemin(UInt128)) == 0.0f0
@test Float64(typemax(UInt128)) == 2.0^128
@test Float32(typemax(UInt128)) == 2.0f0^128
# leading zeros > 53
@test Float64(UInt128(Int64(2)^54)) == 1.8014398509481984e16
@test Float64(Int128(Int64(2)^54)) == 1.8014398509481984e16
@test Float32(UInt128(Int64(2)^54)) == 1.8014399f16
@test Float32(Int128(Int64(2)^54)) == 1.8014399f16

# check for double rounding in conversion
@test Float64(10633823966279328163822077199654060032) == 1.0633823966279327e37 #0x1p123
Expand Down

0 comments on commit 3f8c311

Please sign in to comment.