You could try using a trivial expression, such as a+0 or -(-a)

julia> a=with_bigfloat_precision(()->BigFloat("0.1"),64)
1.00000000000000000001e-01 with 64 bits of precision

julia> z=a+0
1.000000000000000000013552527156068805425093160010874271392822265625e-01 
with 256 bits of precision

julia> z-a
0e+00 with 256 bits of precision

julia> z===a
false


On Sunday, September 14, 2014 9:56:32 AM UTC+10, Rick Graham wrote:
>
> Might be a silly question, but how do you copy a BigFloat so that it is 
> independent of the original?
>
>
> julia> a=with_bigfloat_precision(()->BigFloat("0.1"),64)
> 1.00000000000000000001e-01 with 64 bits of precision
>
>
> julia> z=copy(a)
> 1.00000000000000000001e-01 with 64 bits of precision
>
>
> julia> a.d==z.d
> true
>
>
> julia> z=deepcopy(a)
> 1.00000000000000000001e-01 with 64 bits of precision
>
>
> julia> a.d==z.d
> true
>
>
>
>

Reply via email to