Skip to content

Commit

Permalink
Update mpfr.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
musm committed Aug 18, 2017
1 parent 07c3bed commit a6ea6d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/mpfr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ promote_rule(::Type{BigFloat}, ::Type{<:AbstractFloat}) = BigFloat
big(::Type{<:AbstractFloat}) = BigFloat

function convert(::Type{Rational{BigInt}}, x::AbstractFloat)
isnan(x) && return zero(BigInt)//zero(BigInt)
isinf(x) && return copysign(one(BigInt),x)//zero(BigInt)
isnan(x) && return zero(BigInt) // zero(BigInt)
isinf(x) && return copysign(one(BigInt),x) // zero(BigInt)
x == 0 && return zero(BigInt) // one(BigInt)
s = max(precision(x) - exponent(x), 0)
BigInt(ldexp(x,s)) // (BigInt(1) << s)
Expand Down

0 comments on commit a6ea6d4

Please sign in to comment.