Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
BigDecimal#**
self ** other → bigdecimal
ext/bigdecimal/bigdecimal.c
View on GitHub ↗
static VALUE
BigDecimal_power_op(VALUE self, VALUE exp)
{
return BigDecimal_power(1, &exp, self);
}
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.