# Using wolframclient and arbitrary precision numbers

**URL:** <https://community.wolfram.com/t/using-wolframclient-and-arbitrary-precision-numbers/20183>\
**Category:** Questions\
**Created:** [June 19, 2022, 2:31pm UTC](https://community.wolfram.com/t/using-wolframclient-and-arbitrary-precision-numbers/20183 "2022-06-19T14:31:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpmihaylovwolfram](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@dpmihaylovwolfram](https://community.wolfram.com/u/dpmihaylovwolfram)\
**Post date:** [June 19, 2022, 2:31pm UTC](https://community.wolfram.com/t/using-wolframclient-and-arbitrary-precision-numbers/20183/1 "2022-06-19T14:31:35Z")

</div>

Hello, I am using `wolframclient` for a project, and I have gotten the hang of it. However, I want to use it for arbitrary precision arithmetic, which means passing arbitrary precision numbers between python and the Mathematica kernel and back. Is there a way to do this. Some stuff I have tried already:

```
with WolframLanguageSession() as session:
    x = session.evaluate(wl.ToString(wl.N(1/3, 100)))
    print(x)

```

which gives `0.333333`

I have also tried passing the numbers to a function from an external .m package, without success:

```
with WolframLanguageSession() as session:
    session.evaluate(wl.SetDirectory("mathematica_files"))
    session.evaluate(wl.Needs('MyPackage`'))
    session.evaluate(wl.ResetDirectory())

    a = wl.N(33/100, 100)
    b = wl.N(24/100, 100)

    res = session.evaluate(
        wl.MyPackage.MyFunction(a,b)
    )

    print(res)

```

which again gives a less-than-machine-prec number.

Is there any way to serialize some python library type which would allow me to make use of high-precision arithmetic in Mathematica?

---

<div class="post-metadata">

**Author:** ![dpmihaylovwolfram](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@dpmihaylovwolfram](https://community.wolfram.com/u/dpmihaylovwolfram)\
**Post date:** [June 19, 2022, 2:47pm UTC](https://community.wolfram.com/t/using-wolframclient-and-arbitrary-precision-numbers/20183/2 "2022-06-19T14:47:09Z")

</div>

In Mathematica, I can easily use arbitrary precision arithmetic with my function:

```
In[79]:= N[MyFunction[33/100, 24/100], 100]

Out[79]= 1.88738779815070197734299179845518640219851026216604601501806249175530\
1802345986221767363158187993378

```
