Skip to content

Commit

Permalink
Update intfuncs.jl
Browse files Browse the repository at this point in the history
otherwise, even tough `pad` should be non-negative
julia> digits(5,2,uint64(8))
ERROR: `digits` has no method matching digits(::Int64, ::Int64, ::Uint64)

backport of 07f26b4
  • Loading branch information
goretkin authored and tkelman committed Nov 19, 2014
1 parent ab7c6eb commit ceb9632
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/intfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,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)
Expand Down

0 comments on commit ceb9632

Please sign in to comment.