| applying-the-exp-operator_A1.js |
---
esid: sec-applying-the-exp-operator
description: If exponent is NaN, the result is NaN.
--- |
682 |
- |
| applying-the-exp-operator_A2.js |
---
esid: sec-applying-the-exp-operator
description: >
If exponent is +0, the result is 1, even if base is NaN.
--- |
715 |
- |
| applying-the-exp-operator_A3.js |
---
esid: sec-applying-the-exp-operator
description: >
If exponent is −0, the result is 1, even if base is NaN.
--- |
702 |
- |
| applying-the-exp-operator_A4.js |
---
esid: sec-applying-the-exp-operator
description: If base is NaN and exponent is nonzero, the result is NaN.
--- |
705 |
- |
| applying-the-exp-operator_A5.js |
---
esid: sec-applying-the-exp-operator
description: If abs(base) > 1 and exponent is +∞, the result is +∞.
--- |
689 |
- |
| applying-the-exp-operator_A6.js |
---
esid: sec-applying-the-exp-operator
description: If abs(base) > 1 and exponent is −∞, the result is +0.
--- |
675 |
- |
| applying-the-exp-operator_A7.js |
---
esid: sec-applying-the-exp-operator
description: If abs(base) is 1 and exponent is +∞, the result is NaN.
--- |
455 |
- |
| applying-the-exp-operator_A8.js |
---
esid: sec-applying-the-exp-operator
description: If abs(base) is 1 and exponent is −∞, the result is NaN.
--- |
457 |
- |
| applying-the-exp-operator_A9.js |
---
esid: sec-applying-the-exp-operator
description: If abs(base) < 1 and exponent is +∞, the result is +0.
--- |
562 |
- |
| applying-the-exp-operator_A10.js |
---
esid: sec-applying-the-exp-operator
description: If abs(base) < 1 and exponent is −∞, the result is +∞.
--- |
584 |
- |
| applying-the-exp-operator_A11.js |
---
esid: sec-applying-the-exp-operator
description: If base is +∞ and exponent > 0, the result is +∞.
--- |
597 |
- |
| applying-the-exp-operator_A12.js |
---
esid: sec-applying-the-exp-operator
description: If base is +∞ and exponent < 0, the result is +0.
--- |
592 |
- |
| applying-the-exp-operator_A13.js |
---
esid: sec-applying-the-exp-operator
description: If base is −∞ and exponent > 0 and exponent is an odd integer, the result is −∞.
--- |
548 |
- |
| applying-the-exp-operator_A14.js |
---
esid: sec-applying-the-exp-operator
description: If base is −∞ and exponent > 0 and exponent is not an odd integer, the result is +∞.
--- |
654 |
- |
| applying-the-exp-operator_A15.js |
---
esid: sec-applying-the-exp-operator
description: If base is −∞ and exponent < 0 and exponent is an odd integer, the result is −0.
--- |
534 |
- |
| applying-the-exp-operator_A16.js |
---
esid: sec-applying-the-exp-operator
description: If base is −∞ and exponent < 0 and exponent is not an odd integer, the result is +0.
--- |
654 |
- |
| applying-the-exp-operator_A17.js |
---
esid: sec-applying-the-exp-operator
description: If base is +0 and exponent > 0, the result is +0.
--- |
567 |
- |
| applying-the-exp-operator_A18.js |
---
esid: sec-applying-the-exp-operator
description: If base is +0 and exponent < 0, the result is +∞.
--- |
599 |
- |
| applying-the-exp-operator_A19.js |
---
esid: sec-applying-the-exp-operator
description: If base is −0 and exponent > 0 and exponent is an odd integer, the result is −0.
--- |
523 |
- |
| applying-the-exp-operator_A20.js |
---
esid: sec-applying-the-exp-operator
description: If base is −0 and exponent > 0 and exponent is not an odd integer, the result is +0.
--- |
629 |
- |
| applying-the-exp-operator_A21.js |
---
esid: sec-applying-the-exp-operator
description: If base is −0 and exponent < 0 and exponent is an odd integer, the result is −∞.
--- |
542 |
- |
| applying-the-exp-operator_A22.js |
---
esid: sec-applying-the-exp-operator
description: If base is −0 and exponent < 0 and exponent is not an odd integer, the result is +∞.
--- |
661 |
- |
| applying-the-exp-operator_A23.js |
---
esid: sec-applying-the-exp-operator
description: If base < 0 and base is finite and exponent is finite and exponent is not an integer, the result is NaN.
--- |
911 |
- |
| bigint-and-number.js |
---
esid: sec-exp-operator-runtime-semantics-evaluation
description: Mixing BigInt and Number produces a TypeError for exponentiation operator
features: [BigInt]
info: |
Let base be ? ToNumeric(leftValue).
Let exponent be ? ToNumeric(rightValue).
If Type(base) does not equal Type(exponent), throw a TypeError exception.
--- |
2271 |
- |
| bigint-arithmetic.js |
---
esid: sec-exp-operator-runtime-semantics-evaluation
description: BigInt exponentiation arithmetic
features: [BigInt]
--- |
3664 |
- |
| bigint-errors.js |
---
description: exponentiation operator ToNumeric with BigInt operands
esid: sec-exp-operator-runtime-semantics-evaluation
features: [BigInt, Symbol, Symbol.toPrimitive, computed-property-names]
--- |
1803 |
- |
| bigint-exp-operator-negative-throws.js |
---
description: If the BigInt exponent is < 0, throw a RangeError exception
esid: sec-exp-operator-runtime-semantics-evaluation
info: |
ExponentiationExpression: UpdateExpression ** ExponentiationExpression
...
9. Return ? Type(base)::exponentiate(base, exponent).
BigInt::exponentiate (base, exponent)
1. If exponent < 0, throw a RangeError exception.
2. If base is 0n and exponent is 0n, return 1n.
3. Return a BigInt representing the mathematical value of base raised to the power exponent.
...
features: [BigInt]
--- |
921 |
- |
| bigint-toprimitive.js |
---
description: exponentiation operator ToNumeric with BigInt operands
esid: sec-exp-operator-runtime-semantics-evaluation
features: [BigInt, Symbol.toPrimitive, computed-property-names]
--- |
7668 |
- |
| bigint-wrapped-values.js |
---
description: exponentiation operator ToNumeric with BigInt operands
esid: sec-exp-operator-runtime-semantics-evaluation
features: [BigInt, Symbol.toPrimitive, computed-property-names]
--- |
1147 |
- |
| bigint-zero-base-zero-exponent.js |
---
description: If the BigInt base and exponent are both 0n, return 1n
esid: sec-exp-operator-runtime-semantics-evaluation
info: |
ExponentiationExpression: UpdateExpression ** ExponentiationExpression
...
9. Return ? Type(base)::exponentiate(base, exponent).
BigInt::exponentiate (base, exponent)
1. If exponent < 0, throw a RangeError exception.
2. If base is 0n and exponent is 0n, return 1n.
3. Return a BigInt representing the mathematical value of base raised to the power exponent.
...
features: [BigInt]
--- |
705 |
- |
| exp-assignment-operator.js |
---
author: Rick Waldron
esid: sec-assignment-operators-runtime-semantics-evaluation
description: Compound Exponentiation Assignment Operator
info: |
AssignmentExpression:
LeftHandSideExpression AssignmentOperator AssignmentExpression
1. Let lref be the result of evaluating LeftHandSideExpression.
2. Let lval be ? GetValue(lref).
3. Let rref be the result of evaluating AssignmentExpression.
4. Let rval be ? GetValue(rref).
5. Let op be the @ where AssignmentOperator is @=.
6. Let r be the result of applying op to lval and rval as if evaluating the expression lval op rval.
7. Perform ? PutValue(lref, r).
8. Return r.
--- |
899 |
- |
| exp-operator-evaluation-order.js |
---
author: Rick Waldron, André Bargull
esid: sec-exp-operator-runtime-semantics-evaluation
description: Exponentiation Operator expression order of evaluation
info: |
ExponentiationExpression:
UpdateExpression ** ExponentiationExpression
1. Let left be the result of evaluating UpdateExpression.
2. Let leftValue be ? GetValue(left).
3. Let right be the result of evaluating ExponentiationExpression.
4. Let rightValue be ? GetValue(right).
5. Let base be ? ToNumber(leftValue).
6. Let exponent be ? ToNumber(rightValue).
7. Return the result of Applying the ** operator with base and exponent as specified in 12.7.3.4.
--- |
1516 |
- |
| exp-operator-precedence-unary-expression-semantics.js |
---
author: Rick Waldron
esid: sec-unary-operators
description: Exponentiation Operator expression precedence of unary operators
info: |
ExponentiationExpression :
UnaryExpression
...
UnaryExpression :
...
`delete` UnaryExpression
`void` UnaryExpression
`typeof` UnaryExpression
`+` UnaryExpression
`-` UnaryExpression
`~` UnaryExpression
`!` UnaryExpression
--- |
2483 |
- |
| exp-operator-precedence-update-expression-semantics.js |
---
author: Rick Waldron
esid: sec-update-expressions
description: Exponentiation Operator expression precedence of update operators
info: |
ExponentiationExpression :
...
UpdateExpression `**` ExponentiationExpression
UpdateExpression :
LeftHandSideExpression `++`
LeftHandSideExpression `--`
`++` UnaryExpression
`--` UnaryExpression
--- |
1592 |
- |
| exp-operator-syntax-error-bitnot-unary-expression-base.js |
---
author: Rick Waldron
esid: sec-unary-operators
description: Exponentiation Expression syntax error, `~` UnaryExpression
info: |
ExponentiationExpression :
UnaryExpression
...
UnaryExpression :
...
`~` UnaryExpression
...
negative:
phase: parse
type: SyntaxError
--- |
501 |
- |
| exp-operator-syntax-error-delete-unary-expression-base.js |
---
author: Rick Waldron
esid: sec-unary-operators
description: Exponentiation Expression syntax error, `delete` UnaryExpression
info: |
ExponentiationExpression :
UnaryExpression
...
UnaryExpression :
...
`delete` UnaryExpression
...
negative:
phase: parse
type: SyntaxError
--- |
519 |
- |
| exp-operator-syntax-error-logical-not-unary-expression-base.js |
---
author: Rick Waldron
esid: sec-unary-operators
description: Exponentiation Expression syntax error, `!` UnaryExpression
info: |
ExponentiationExpression :
UnaryExpression
...
UnaryExpression :
...
`!` UnaryExpression
...
negative:
phase: parse
type: SyntaxError
--- |
501 |
- |
| exp-operator-syntax-error-negate-unary-expression-base.js |
---
author: Rick Waldron
esid: sec-unary-operators
description: Exponentiation Expression syntax error, `-` UnaryExpression
info: |
ExponentiationExpression :
UnaryExpression
...
UnaryExpression :
...
`-` UnaryExpression
...
negative:
phase: parse
type: SyntaxError
--- |
501 |
- |
| exp-operator-syntax-error-plus-unary-expression-base.js |
---
author: Rick Waldron
esid: sec-unary-operators
description: Exponentiation Expression syntax error, `+` UnaryExpression
info: |
ExponentiationExpression :
UnaryExpression
...
UnaryExpression :
...
`+` UnaryExpression
...
negative:
phase: parse
type: SyntaxError
--- |
501 |
- |
| exp-operator-syntax-error-typeof-unary-expression-base.js |
---
author: Rick Waldron
esid: sec-unary-operators
description: Exponentiation Expression syntax error, `typeof` UnaryExpression
info: |
ExponentiationExpression :
UnaryExpression
...
UnaryExpression :
...
`typeof` UnaryExpression
...
negative:
phase: parse
type: SyntaxError
--- |
517 |
- |
| exp-operator-syntax-error-void-unary-expression-base.js |
---
author: Rick Waldron
esid: sec-unary-operators
description: Exponentiation Expression syntax error, `void` UnaryExpression
info: |
ExponentiationExpression :
UnaryExpression
...
UnaryExpression :
...
`void` UnaryExpression
...
negative:
phase: parse
type: SyntaxError
--- |
511 |
- |
| exp-operator.js |
---
author: Rick Waldron
esid: sec-exp-operator
description: >
Performs exponential calculation on operands. Same algorithm as %MathPow%(base, exponent)
--- |
834 |
- |
| int32_min-exponent.js |
---
esid: sec-applying-the-exp-operator
description: >
Using -(2**31) as exponent with the exponentiation operator should behave
as expected.
--- |
612 |
- |
| order-of-evaluation.js |
---
esid: sec-exp-operator-runtime-semantics-evaluation
description: Type coercion order of operations for exponentiation operator
features: [Symbol]
info: |
Evaluate lhs
Evaluate rhs
ToNumeric(lhs)
ToNumeric(rhs)
--- |
3016 |
- |