Skip to main content

Decimal.^

^exp

Group: Operators
Aliases: power

Documentation

Compute the result of raising this to the positive integer power exp.

Arguments

  • exp: The exponent. Must be an integer in the range 0 through 999999999 (inclusive).

Examples

Computing 2.25 to the fifth power.

      Decimal.new "2.25" ^ Decimal.new "5"
# => 57.6650390625

Errors

  • If exp is outside the range 0 through 999999999 (inclusive), Arithmetic_Error will be thrown.