From 07f26b491ee2091afd1b06924899a7514abe03fa Mon Sep 17 00:00:00 2001 From: Gustavo Goretkin Date: Wed, 12 Nov 2014 14:10:39 -0500 Subject: [PATCH] Update intfuncs.jl otherwise, even tough `pad` should be non-negative julia> digits(5,2,uint64(8)) ERROR: `digits` has no method matching digits(::Int64, ::Int64, ::Uint64) --- base/intfuncs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/intfuncs.jl b/base/intfuncs.jl index 839ff370d4da4..11e3cb937979f 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -306,7 +306,7 @@ bits(x::Union(Char,Int32,UInt32,Float32)) = bin(reinterpret(UInt32,x),32) bits(x::Union(Int64,UInt64,Float64)) = bin(reinterpret(UInt64,x),64) bits(x::Union(Int128,UInt128)) = bin(reinterpret(UInt128,x),128) -function digits{T<:Integer}(n::Integer, base::T=10, pad::Int=1) +function digits{T<:Integer}(n::Integer, base::T=10, pad::Integer=1) 2 <= base || error("invalid base: $base") m = max(pad,ndigits0z(n,base)) a = zeros(T,m)