Operators

Exponentiation (^)

Matches all 42 recorded answers

Recorded: 42 workbook cells. How we measure this · See the Rust code

No local names are recorded for this entry.

What it does

number1 ^ number2

A ^ B converts both operands to numbers and returns A raised to the power B, as a real value.

The word "real" is the entire specification. Unlike IEEE-754's pow, which is defined over extended reals and returns infinities and NaN, the worksheet's ^ is a real-valued power with three consequences:

  1. Zero to the zero is refused. The same record observes =0^0 and =POWER(0,0) as #NUM! on the replayed baseline (Excel 16.0 build 19929, replay dated 2026-04-29 in that record). This is the single most surprising fact on this page: mathematics conventionally defines 0^0 = 1, C's pow(0,0) returns 1, and Excel — on that observation — does not. The Handbook reports the record; it has not re-measured it.

The second specification-level fact is how the power is computed. Chapter 03 describes a declared publication axis, PrecisionRoundingProfile::IntegerExponentPublication: when the exponent is an exact integer, Excel computes the power by repeated multiplication (binary exponentiation) rather than by the transcendental exp(b·ln a) path, and the two disagree in the last bits. Chapter 03 names POWER and the ^ operator as the carriers of that axis and gives a worked POWER(1.05, 10) example.

Arguments

PositionNameMeaning
0ABase. Required.
1BExponent. Required.

Arity is exactly 2; no optional arguments, no defaults. Order is emphatically load-bearing.

The exponent's exactness as an integer is a semantic input, not a formatting detail: on the integer-exponent publication rule, x^3 and x^3.0000000000000004 may take different computation paths, and a spreadsheet that computes its exponent rather than typing it can land on either side of that boundary without the author noticing.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

Result and edge cases

  • Negative base, integer exponent. Real and well defined; the sign alternates with the parity of the exponent.
  • Zero base. Positive exponent gives zero; negative exponent is recorded as #DIV/0!; zero exponent is recorded as #NUM! (see above).
  • Base 1 and exponent 0 are the usual identities, with the 0^0 exception above the only interesting corner.
  • Text and logical operands. Shared to-number rules from coercion and lifting.

How to implement

Notes for implementers

  • Implement two paths deliberately: an exact-integer-exponent path by binary exponentiation and a general path, and make the integer test exact (the exponent must be an integer as a double, not merely close to one). This is the difference chapter 03 records as observable.
  • Binary exponentiation is not associativity-free either. x^10 computed as ((x^2)^2 · x)^2 and as x·x·…·x differ in the last bits; a compatibility implementation must pin the exact multiplication schedule, not merely "repeated multiplication".
  • Route the domain checks before the kernel, in this order: error operands, coercion failures, zero-base cases, negative-base-non-integer-exponent, then the arithmetic. Reordering these changes which error a doubly-bad operand pair produces.
  • Never let a library pow return an infinity or NaN to the publication layer. The worksheet value universe has no such values (chapter 01); every non-finite must be mapped to an error or a documented saturation before it reaches a cell.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

^ infix · 1 lines · calc-func/src/catalogue/arithmetic.rs on GitHub
CatalogueEntry::operator(POWER, "^", Notation::Infix, NUMBERS, power)
power · 7 lines · calc-func/src/catalogue/arithmetic.rs on GitHub
fn power(
    arguments: &[CalcValue],
    services: &mut EvalServices<'_>,
) -> Result<CalcValue, FunctionFault> {
    let site = Site::new(POWER, services);
    Site::finish(operands(&site, arguments).and_then(|(x, y)| power_value(&site, x, y)))
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

Alternatives

Relationships

  • EXP, LN, LOG, LOG10 — the transcendental path ^ is documented not to take for integer exponents.
  • SQRT — x^0.5 and SQRT(x) are different implementations of the same mathematical function. SQRT is a correctly-rounded IEEE primitive; a general power path usually is not. Prefer SQRT where you can.
  • IMPOWER — complex powers over text-encoded complex numbers, which does return a negative real base's fractional power as a complex value.
  • FUNC.OP_MULTIPLY — what the integer-exponent path reduces to.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents