Hello, I have a small problem with SaferIntegers, still using the same code:
function collatz(lim)
max=1
for i in 1:lim
c=0
n=SafeUInt64(i)
while n!=1
if n&1==0 n>>=1
else n=3*n+1
end
c+=1
end
if c>max
max=c
println("at $i new max=$max")
end
end
end
collatz(1000)
ERROR: MethodError: >>(::SaferIntegers.SafeUInt64, ::Int64) is ambiguous. Candidates:
(x::T1, y::T2) where {T2<:Integer, T1<:SaferIntegers.SafeInteger} in SaferIntegers at /home/jmichel/.julia/v0.6/SaferIntegers/src/binary_ops.jl:54
(x::Integer, c::Int64) in Base at operators.jl:528
Possible fix, define
(::T1<:SaferIntegers.SafeInteger, ::Int64)
Stacktrace:
[1] collatz(::Int64) at /home/jmichel/collatz.jl:7