power
Raise a number to an exponent. Provide the base and exponent to compute the result.
Instructions
Raises a to the power of b.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | ||
| exponent | Yes |
Implementation Reference
- cruncher.js:1354-1361 (handler)The handler function for the 'power' tool. It takes 'base' and 'exponent' arguments and returns Math.pow(base, exponent).
/** * Calculates a number raised to a power. * @param {Object} args - The arguments object. * @param {number} args.base - The base number. * @param {number} args.exponent - The exponent. * @returns {number} The result of base raised to the power of exponent. */ power: ({ base, exponent }) => Math.pow(base, exponent),