power
Raise a base number to a given exponent and get the result. Handles invalid operations like overflow or complex results with clear errors.
Instructions
Raise a number to a power.
Args: base: The base number. exponent: The power to raise the base to.
Returns: base raised to the power of exponent.
Raises: InvalidPowerOperationError: If the result would be complex, or if the computation overflows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | ||
| exponent | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |