Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

BigDecimal#**

self ** other → bigdecimal

Returns the BigDecimal value of self raised to power other:

Example
b = BigDecimal('3.14')
b ** 2              # => 0.98596e1
b ** 2.0            # => 0.98596e1
b ** Rational(2, 1) # => 0.98596e1

Related: BigDecimal#power.

See also #* #+ #% #+@ also in 3.2 · 3.1 · 3.0