# How julia calculates pi?

**URL:** <https://discourse.julialang.org/t/how-julia-calculates-pi/87094>\
**Category:** Offtopic\
**Created:** [September 11, 2022, 7:09pm UTC](https://discourse.julialang.org/t/how-julia-calculates-pi/87094 "2022-09-11T19:09:06Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [September 12, 2022, 9:16am UTC](https://discourse.julialang.org/t/how-julia-calculates-pi/87094/13 "2022-09-12T09:16:57Z")

</div>

> [@digital\_carver](#):
>
> Julia uses the MPFR C library’s [mpfr\_const\_pi](https://www.mpfr.org/mpfr-current/mpfr.html#index-mpfr_005fconst_005fpi) function.

For those who are curious how it is implemented, you can read the source here: [src/const\_pi.c · master · mpfr / mpfr · GitLab](https://gitlab.inria.fr/mpfr/mpfr/-/blob/master/src/const_pi.c#L41-122)

---

_[View the full topic](https://discourse.julialang.org/t/how-julia-calculates-pi/87094)._
