# How to properly work with changing precision in ArbNumerics

**URL:** https://discourse.julialang.org/t/how-to-properly-work-with-changing-precision-in-arbnumerics/102775
**Category:** Numerics
**Tags:** question, numerics, precision
**Created:** [August 13, 2023, 8:30pm UTC](https://discourse.julialang.org/t/how-to-properly-work-with-changing-precision-in-arbnumerics/102775 "2023-08-13T20:30:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)
#### Post date: [August 13, 2023, 8:30pm UTC](https://discourse.julialang.org/t/how-to-properly-work-with-changing-precision-in-arbnumerics/102775/1 "2023-08-13T20:30:10Z")

</div>

I do not understand how I should properly work with [ArbNumerics](https://jeffreysarnoff.github.io/ArbNumerics.jl/stable/).

I tried setting the number of digits at the beginning of my code, so that later I easily change the number of digits for all of my variables.

```julia
digits = 200
a = ArbReal(1.0, bits=digits)

```

However, when I later use functions in `Roots.jl` using some other ArbFloat variables I get errors that regard the number of bits, because the default value of generating ArbFloat is 128.

This is an example of something that I do not understand:

```julia
digits = 104
a = ArbReal(0.2, bits=digits)
b = ArbReal(0.0008173251288155428, digits=digits)
typeof(a) # ArbReal{128}
typeof(b) # ArbReal{372}

```

Why is the type different?

---

<div class="post-metadata">

### Author: ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)
#### Post date: [August 13, 2023, 8:38pm UTC](https://discourse.julialang.org/t/how-to-properly-work-with-changing-precision-in-arbnumerics/102775/2 "2023-08-13T20:38:19Z")

</div>

On the phone, and I dont know anything about that package, but just noted that in one case you use the bits keyword and the other you use digits, is that intentional?

---

<div class="post-metadata">

### Author: ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)
#### Post date: [August 13, 2023, 9:03pm UTC](https://discourse.julialang.org/t/how-to-properly-work-with-changing-precision-in-arbnumerics/102775/3 "2023-08-13T21:03:17Z")

</div>

My bad. thanks! I got so confused…
