Julia has the built-in constant pi
, with type Irrational
.
julia> pi
π = 3.1415926535897...
julia> π
π = 3.1415926535897...
julia> typeof(pi)
Irrational{:π}
Coming from SymPy, which has the N()
function, I would like to evaluate pi
(or other Irrational
s, such as e
, golden
, etc.) to n digits.
In [5]: N(pi, n=50)
Out[5]: 3.1415926535897932384626433832795028841971693993751
Is this possible? I am assuming that pi
is based on its mathematical definition, rather than just to thirteen decimal places.