Skip to content

Commit e5b32a9

Browse files
committed
fix ambiguity warnings trunc(BigInt,::Float16)
1 parent 966850c commit e5b32a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

base/gmp.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ end
121121
convert(::Type{BigInt}, x::Bool) = BigInt(UInt(x))
122122

123123

124-
function unsafe_trunc(::Type{BigInt}, x::CdoubleMax)
124+
function unsafe_trunc(::Type{BigInt}, x::Union{Float32,Float64})
125125
z = BigInt()
126126
ccall((:__gmpz_set_d, :libgmp), Void, (Ptr{BigInt}, Cdouble), &z, x)
127127
return z
128128
end
129129

130-
function convert(::Type{BigInt}, x::CdoubleMax)
130+
function convert(::Type{BigInt}, x::Union{Float32,Float64})
131131
isinteger(x) || throw(InexactError())
132132
unsafe_trunc(BigInt,x)
133133
end
134134

135-
function trunc(::Type{BigInt}, x::CdoubleMax)
135+
function trunc(::Type{BigInt}, x::Union{Float32,Float64})
136136
isfinite(x) || throw(InexactError())
137137
unsafe_trunc(BigInt,x)
138138
end

0 commit comments

Comments
 (0)