The pi constant is usually available in the math.h header
Anyway besides being defined as the ratio between the circumference and diameter, the value of \( \pi \) can also be approximate with the help of Leibniz’s formula
and this can be computed in \( O(n) \) where \( n \) is the number of iterations at runtime or directly at compile-time moving the bulk of the work to the compiler itself with templates