Complexifying pi

The type exists already:

julia> complex(pi, pi) |> typeof
Complex{Irrational{:π}}

but the point is that the parameter of Complex{T} is the type of both the real and the imaginary parts, so the only way to build a Complex{Irrational{...}} is to do complex(x, x) with x isa Irrational.

If one wants to have complex(pi) with the highest precision possible, complex(big(pi)) is the only solution currently.

For more information see:

3 Likes