Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. 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.2 · 3.1 · 3.0