Double asterisk raises a numeric base to a numeric exponent—squaring a rate factor, cubing a unit conversion constant, or computing compound growth in analytical utilities. Exponentiation appears less often in classic nightly payroll than plus, minus, asterisk, and slash, but batch installations use ** in interest accrual prototypes, statistical sampling utilities, and engineering interface programs. ** binds tighter than multiplication and division—BASE * RATE ** 2 may square RATE before multiply depending on operand positions; parenthesize when business formula does not match default precedence. Results explode in magnitude—2 ** 20 exceeds million; packed field overflow abends or corrupts. This page teaches syntax, precedence, associativity footguns, sizing targets, contrast with multiply, and when repeated multiply replaces ** for clarity in maintenance-sensitive code.
TARGET = base ** exponent. SQUARE = VALUE ** 2. CUBE = VALUE ** 3. Exponent may be field or literal—POWER = BASE ** EXP when exponent varies. Integer exponents most common in batch; fractional exponent semantics verify on installation if used.
123SQUARE = RATE ** 2 VOLUME = SIDE ** 3 RESULT = BASE ** EXPONENT
| Expression | Evaluation order |
|---|---|
| A * B ** 2 | B ** 2 first, then multiply by A |
| A + B ** 2 | B ** 2 first, then add A |
| (A + B) ** 2 | Add A + B first, then square |
| A ** B ** C | Associativity—parenthesize explicitly |
2 ** 3 ** 2 may parse as (2 ** 3) ** 2 = 64 or 2 ** (3 ** 2) = 512 depending on product associativity rules—never leave ambiguous in financial code. Write explicit parens. Exponent towers grow fast—2 ** (2 ** 5) is astronomical for small fixed fields.
DEFINE RESULT W 15 P 4 for large intermediate when BASE and EXPONENT vary. Test MAX production values. Overflow invalidates packed sign—abend. For modest squares, W 11 P 4 may suffice when BASE known bounded.
SQUARE = X * X equivalent to X ** 2 for readability in some shops—no precedence surprise. CUBE = X * X * X versus X ** 3—choose style guide consistency. ** wins for exponent field variable when power not 2 or 3.
123* Equivalent square: HOLD1 = RATE ** 2 HOLD2 = RATE * RATE
Payroll tax percentage uses * not **—do not use ** for percent unless formula truly power law.
IF VALUE ** 2 GT THRESHOLD squares before compare—rare. Prefer HOLD = VALUE ** 2; IF HOLD GT THRESHOLD for debug DISPLAY of HOLD.
Double star means multiply a number by itself several times. Two star three means two times two times two—eight. It goes faster than writing many times signs but makes big answers very quickly—pick a big enough box. Do the star group before regular times unless parentheses say otherwise.
1. RESULT = BASE ** 2 computes:
2. ** binds compared to *:
3. 2 ** 10 yields:
4. Exponentiation in payroll batch is:
5. Large exponent on fixed decimal field risks: