# DoubleFloats.jl -\> Double128 | Quad64?

**URL:** <https://discourse.julialang.org/t/doublefloats-jl-double128-quad64/51049>\
**Category:** Numerics\
**Created:** [December 1, 2020, 3:33pm UTC](https://discourse.julialang.org/t/doublefloats-jl-double128-quad64/51049 "2020-12-01T15:33:07Z")\
**Posts on this page:** 1\
**Showing post:** 35

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [December 8, 2020, 11:17am UTC](https://discourse.julialang.org/t/doublefloats-jl-double128-quad64/51049/35 "2020-12-08T11:17:31Z")

</div>

Here is a faster way to multiply BigFloats (it avoids the internal allocation).

```julia
function mul!(z::BigFloat, x::BigFloat, y::BigFloat)
  ccall(("mpfr_mul",:libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Ref{BigFloat}, Base.MPFR.MPFRRoundingMode), z, x, y, Base.MPFR.ROUNDING_MODE[])
  return z
end
mul! (generic function with 1 method)

# or

function mul!(z::BigFloat, x::BigFloat, y::BigFloat)
  ccall(("mpfr_mul",:libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Ref{BigFloat}, Base.MPFR.MPFRRoundingMode), z, x, y, Base.MPFR.ROUNDING_MODE[])
  return nothing
end

z=BigFloat(); x = BigFloat(pi); y = sqrt(BigFloat(2));
mul!(z, x, y)
z

```

(about 1.3x faster on a single multiply)

---

_[View the full topic](https://discourse.julialang.org/t/doublefloats-jl-double128-quad64/51049)._
