Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

BigMath#PI

PI(numeric) → BigDecimal

Computes the value of pi to the specified number of digits of precision, numeric.

Example
BigMath.PI(10).to_s
#=> "0.3141592653589793238462643388813853786957412e1"
See also #E #sin #cos #sqrt also in 3.3 · 3.2 · 3.0