Skip to content

Commit a85476b

Browse files
committed
Fix ambiguity warning (Rational->BigFloat conversion)
1 parent d265f4d commit a85476b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/rational.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ convert(::Type{Bool}, x::Rational) = (x!=0) # to resolve ambiguity
4545
convert{T<:Integer}(::Type{T}, x::Rational) = (isinteger(x) ? convert(T, x.num) : throw(InexactError()))
4646

4747
convert(::Type{FloatingPoint}, x::Rational) = float(x.num)/float(x.den)
48-
function convert{T<:FloatingPoint,S}(::Type{T}, x::Rational{S})
48+
function convert{T<:FloatingPoint,S<:Integer}(::Type{T}, x::Rational{S})
4949
P = promote_type(T,S)
5050
convert(P,x.num)/convert(P,x.den)
5151
end

0 commit comments

Comments
 (0)