# Float64 but with single precision

**URL:** <https://discourse.julialang.org/t/float64-but-with-single-precision/102899>\
**Category:** Numerics\
**Created:** [August 17, 2023, 10:13am UTC](https://discourse.julialang.org/t/float64-but-with-single-precision/102899 "2023-08-17T10:13:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dario-Rosa85](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dario-rosa85/32/32358_2.png) [@Dario-Rosa85](https://discourse.julialang.org/u/Dario-Rosa85)\
**Post date:** [August 17, 2023, 10:13am UTC](https://discourse.julialang.org/t/float64-but-with-single-precision/102899/1 "2023-08-17T10:13:53Z")

</div>

Sorry for the question which might look a bit stupid. I am preparing an example to show that certain numerical methods are unstable. To do this, I would need a method to use a Float64 number but, for the example, I would like to have an accuracy of only order 10^(-6). Do you know how to do that?

---

<div class="post-metadata">

**Author:** ![algunion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/algunion/32/51630_2.png) [@algunion](https://discourse.julialang.org/u/algunion)\
**Post date:** [August 17, 2023, 10:30am UTC](https://discourse.julialang.org/t/float64-but-with-single-precision/102899/2 "2023-08-17T10:30:44Z")

</div>

Check out the [ArbNumerics.jl](https://jeffreysarnoff.github.io/ArbNumerics.jl/stable/) package.

```julia
using ArbNumerics

function with_arbitrary(x::Float64)
    arbx = ArbFloat(x, digits=10)
    arbx + 1.0
end

sqrt(2.0) + 1.0 # 2.414213562373095....
with_arbitrary(sqrt(2.0)) # 2.414213562

```
