# How to use gmpy2 bigints in Julia

**URL:** https://discourse.julialang.org/t/how-to-use-gmpy2-bigints-in-julia/117171
**Category:** New to Julia
**Tags:** question
**Created:** [July 18, 2024, 6:32am UTC](https://discourse.julialang.org/t/how-to-use-gmpy2-bigints-in-julia/117171 "2024-07-18T06:32:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![gerryj](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gerryj](https://discourse.julialang.org/u/gerryj)
#### Post date: [July 18, 2024, 6:32am UTC](https://discourse.julialang.org/t/how-to-use-gmpy2-bigints-in-julia/117171/1 "2024-07-18T06:32:27Z")

</div>

I am using gmpy2 in python for bigints, 2000+ digits. I just import the functions i need and use them directly. Can i do that in Julia? How so?.  
If the answer is make a python call, has anyone checked the comparative performance?

---

<div class="post-metadata">

### Author: ![cmarcotte](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@cmarcotte](https://discourse.julialang.org/u/cmarcotte)
#### Post date: [July 18, 2024, 8:18am UTC](https://discourse.julialang.org/t/how-to-use-gmpy2-bigints-in-julia/117171/2 "2024-07-18T08:18:09Z")

</div>

You can simply use `BigInt` in julia, though I can’t speak to the performance compared to gmpy2 in python. `BigInt(10)^2000` for example will (quickly) return 10^{2000}.

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [July 18, 2024, 11:22am UTC](https://discourse.julialang.org/t/how-to-use-gmpy2-bigints-in-julia/117171/3 "2024-07-18T11:22:50Z")

</div>

they both use GMP so the performance should be identical

---

<div class="post-metadata">

### Author: ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)
#### Post date: [July 18, 2024, 11:56am UTC](https://discourse.julialang.org/t/how-to-use-gmpy2-bigints-in-julia/117171/4 "2024-07-18T11:56:45Z")

</div>

Bigints are built into Julia. No need to import anything.
