Yes, I do think that's a good solution.

On Thu, May 14, 2015 at 2:32 PM, harven <[email protected]> wrote:

> Thanks for the answer. I understand now. So log(2,x) is log(x)/log(2) and
> the denominator is a Float64 so we don't get the desired precision. So I
> can just write
>
>       julia> with_bigfloat_precision(10_000) do
>                log(big(2)^10_000)/log(big(2))
>              end
>       1e+04 with 10000 bits of precision
>
> A solution maybe is to promote the base to the same type as the argument?
>
>       julia> mylog(b,x) = log(x)/log(oftype(x,b))
>       mylog (generic function with 1 method)
>
>       julia> with_bigfloat_precision(10_000) do
>                mylog(2,big(2)^10_000)
>               end
>       1e+04 with 10000 bits of precision
>

Reply via email to