Skip to content

Commit

Permalink
use eps instead of pow for ldexp
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Feb 9, 2017
1 parent 30334d2 commit 1282205
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ function ldexp{T<:AbstractFloat}(x::T, e::Integer)
return flipsign(T(0.0), x)
end
k += significand_bits(T)
z = T(2.0)^-significand_bits(T)
z = eps(T)
xu = (xu & ~exponent_mask(T)) | (rem(k, fpinttype(T)) << significand_bits(T))
return z*reinterpret(T, xu)
end
Expand Down

0 comments on commit 1282205

Please sign in to comment.