Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function log(k::BigInt)
- if k < 10
- println(0)
- return
- end
- p = Array{BigInt}(0)
- num = BigInt(10)
- ex = 1
- res = 0
- push!(p,num)
- while num*num <= k
- num *= num
- ex *= 2
- push!(p,num)
- end
- i = length(p)
- k = div(k,num)
- res += ex
- while k >= 10
- if p[i] <= k
- k = div(k,p[i])
- res += ex
- end
- i -= 1
- ex = div(ex,2)
- end
- println(res)
- end
- log(9*BigInt(10)^1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement