diff --git a/spec.html b/spec.html index f7a9ca91722..8c0e40bd9d7 100644 --- a/spec.html +++ b/spec.html @@ -903,13 +903,24 @@

Static Semantics

Mathematical Operations

-

Mathematical operations such as addition, subtraction, negation, multiplication, division, and the mathematical functions defined later in this clause should always be understood as computing exact mathematical results on mathematical real numbers, which unless otherwise noted do not include infinities and do not include a negative zero that is distinguished from positive zero. Algorithms in this standard that model floating-point arithmetic include explicit steps, where necessary, to handle infinities and signed zero and to perform rounding. If a mathematical operation or function is applied to a floating-point number, it should be understood as being applied to the exact mathematical value represented by that floating-point number; such a floating-point number must be finite, and if it is *+0* or *-0* then the corresponding mathematical value is simply 0.

-

The mathematical function abs(_x_) produces the absolute value of _x_, which is -_x_ if _x_ is negative (less than zero) and otherwise is _x_ itself.

-

The mathematical function min(_x1_, _x2_, ..., _xN_) produces the mathematically smallest of _x1_ through _xN_. The mathematical function max(_x1_, _x2_, ..., _xN_) produces the mathematically largest of _x1_ through _xN_. The domain and range of these mathematical functions include *+∞* and *-∞*.

-

The notation “_x_ modulo _y_” (_y_ must be finite and nonzero) computes a value _k_ of the same sign as _y_ (or zero) such that abs(_k_) < abs(_y_) and _x_-_k_ = _q_ × _y_ for some integer _q_.

-

The mathematical function floor(_x_) produces the largest integer (closest to positive infinity) that is not larger than _x_.

+

This specification makes reference to two kinds of numeric values:

+ + +

In the language of this specification, numerical values and operations (including addition, subtraction, negation, multiplication, addition, and comparison) are distinguished among different numeric kinds using subscripts. The subscript 𝕗 refers to Numbers, and the subscript 𝕧 refers to numeric values. A subscript is used following each numeric value and operation. For brevity, the 𝕗 subscript can be omitted on Number values--a numeric value with no subscript is interpreted to be a Number. An operation with no subscript is interpreted to be a Number operation, unless one of the parameters has a particular subscript, in which case the operation adopts that subscript. For example, 1𝕧 + 2𝕧 = 3𝕧 is a statement about mathematical values, and 1 + 2 = 3 is a statement about Numbers. It is not defined to mix Numbers and mathematical values in either arithmetic or comparison operations, and any such undefined operation would be an editorial error in this specification text.

+

The Number value 0, alternatively written 0𝕗, is defined as the double-precision floating point positive zero value. In certain contexts, it may also be written as +0 for clarity.

+

This specification denotes most numeric values in base 10; it also uses numeric values of the form 0x followed by digits 0-9 or A-F as base-16 values.

+

In certain contexts, an operation is specified which is generic between Numbers and mathematical values. In these cases, the subscript can be a variable; _t_ is often used for this purpose, for example 5_t_ * 10_t_ =_t_ 50_t_ for any _t_ ranging over 𝕧 and 𝕗.

+

Conversions between mathematical values and numbers are never implicit, and always explicit in this document. A conversion from a mathematical value to a Number is denoted as "the Number value of _x_", or 𝕗(_x_). A conversion from a Number to a mathematical value is denoted as "the mathematical value of _x_", or 𝕧(_x_). Note that the mathematical value of non-finite values is not defined, and the mathematical value of *+0* and *-0* is the mathematical value 0𝕧. +

When the term integer is used in this specification, it refers to a Number value which whose mathematical value is in set of integers, unless otherwise stated: when the term mathematical integer is used in this specification, it refers to a mathematical value which is in the set of integers. As shorthand, integer_t_ can be used to refer to either of the two, as determined by _t_.

+

The mathematical function abs_t_(_x_) produces the absolute value of _x_, which is -_t__x_ if _x_ <_t_ 0_t_ and otherwise is _x_ itself.

+

The mathematical function min_t_(_x1_, _x2_, ..., _xN_) produces the mathematically smallest of _x1_ through _xN_. The mathematical function max_t_(_x1_, _x2_, ..., _xN_) produces the mathematically largest of _x1_ through _xN_. The domain and range of these mathematical functions include *+∞* and *-∞*.

+

The notation “_x_ modulo_t_ _y_” (_y_ must be finite and nonzero) computes a value _k_ of the same sign as _y_ (or zero) such that abs_t_(_k_) <_t_ abs_t_(_y_) and _x_-_t__k_ = _q_ ×_t_ _y_ for some integer_t_ _q_.

+

The mathematical function floor_t_(_x_) produces the largest integer_t_ (closest to positive infinity) that is not larger than _x_.

-

floor(_x_) = _x_-(_x_ modulo 1).

+

floor_t_(_x_) = _x_-(_x_ modulo_t_ 1_t_).

@@ -1134,27 +1145,27 @@

Well-Known Symbols

The Number Type

-

The Number type has exactly 18437736874454810627 (that is, 264-253+3) values, representing the double-precision 64-bit format IEEE 754-2008 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9007199254740990 (that is, 253-2) distinct “Not-a-Number” values of the IEEE Standard are represented in ECMAScript as a single special *NaN* value. (Note that the *NaN* value is produced by the program expression `NaN`.) In some implementations, external code might be able to detect a difference between various Not-a-Number values, but such behaviour is implementation-dependent; to ECMAScript code, all *NaN* values are indistinguishable from each other.

+

The Number type has exactly 18437736874454810627𝕧 (that is, 2𝕧64𝕧-2𝕧53𝕧+3𝕧) values, representing the double-precision 64-bit format IEEE 754-2008 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9007199254740990𝕧 (that is, 2𝕧53𝕧-2𝕧) distinct “Not-a-Number” values of the IEEE Standard are represented in ECMAScript as a single special *NaN* value. (Note that the *NaN* value is produced by the program expression `NaN`.) In some implementations, external code might be able to detect a difference between various Not-a-Number values, but such behaviour is implementation-dependent; to ECMAScript code, all *NaN* values are indistinguishable from each other.

The bit pattern that might be observed in an ArrayBuffer (see ) or a SharedArrayBuffer (see ) after a Number value has been stored into it is not necessarily the same as the internal representation of that Number value used by the ECMAScript implementation.

There are two other special values, called *positive Infinity* and *negative Infinity*. For brevity, these values are also referred to for expository purposes by the symbols *+∞* and *-∞*, respectively. (Note that these two infinite Number values are produced by the program expressions `+Infinity` (or simply `Infinity`) and `-Infinity`.)

-

The other 18437736874454810624 (that is, 264-253) values are called the finite numbers. Half of these are positive numbers and half are negative numbers; for every finite positive Number value there is a corresponding negative value having the same magnitude.

+

The other 18437736874454810624𝕧 (that is, 2𝕧64𝕧-2𝕧53𝕧) values are called the finite numbers. Half of these are positive numbers and half are negative numbers; for every finite positive Number value there is a corresponding negative value having the same magnitude.

Note that there is both a *positive zero* and a *negative zero*. For brevity, these values are also referred to for expository purposes by the symbols *+0* and *-0*, respectively. (Note that these two different zero Number values are produced by the program expressions `+0` (or simply `0`) and `-0`.)

-

The 18437736874454810622 (that is, 264-253-2) finite nonzero values are of two kinds:

-

18428729675200069632 (that is, 264-254) of them are normalized, having the form

+

The 18437736874454810622𝕧 (that is, 2𝕧64𝕧-2𝕧53𝕧-2𝕧) finite nonzero values are of two kinds:

+

18428729675200069632𝕧 (that is, 2𝕧64𝕧-2𝕧54𝕧) of them are normalized, having the form

_s_ × _m_ × 2_e_
-

where _s_ is +1 or -1, _m_ is a positive integer less than 253 but not less than 252, and _e_ is an integer ranging from -1074 to 971, inclusive.

-

The remaining 9007199254740990 (that is, 253-2) values are denormalized, having the form

+

where _s_ is +1𝕧 or -1𝕧, _m_ is a positive mathematical integer less than 2𝕧53𝕧 but not less than 2𝕧52𝕧, and _e_ is a mathematical integer ranging from -1074𝕧 to 971𝕧, inclusive.

+

The remaining 9007199254740990𝕧 (that is, 2𝕧53𝕧-2𝕧) values are denormalized, having the form

_s_ × _m_ × 2_e_
-

where _s_ is +1 or -1, _m_ is a positive integer less than 252, and _e_ is -1074.

-

Note that all the positive and negative integers whose magnitude is no greater than 253 are representable in the Number type (indeed, the integer 0 has two representations, *+0* and *-0*).

-

A finite number has an odd significand if it is nonzero and the integer _m_ used to express it (in one of the two forms shown above) is odd. Otherwise, it has an even significand.

-

In this specification, the phrase “the Number value for _x_” where _x_ represents an exact real mathematical quantity (which might even be an irrational number such as π) means a Number value chosen in the following manner. Consider the set of all finite values of the Number type, with *-0* removed and with two additional values added to it that are not representable in the Number type, namely 21024 (which is +1 × 253 × 2971) and -21024 (which is -1 × 253 × 2971). Choose the member of this set that is closest in value to _x_. If two values of the set are equally close, then the one with an even significand is chosen; for this purpose, the two extra values 21024 and -21024 are considered to have even significands. Finally, if 21024 was chosen, replace it with *+∞*; if -21024 was chosen, replace it with *-∞*; if *+0* was chosen, replace it with *-0* if and only if _x_ is less than zero; any other chosen value is used unchanged. The result is the Number value for _x_. (This procedure corresponds exactly to the behaviour of the IEEE 754-2008 “round to nearest, ties to even” mode.)

+

where _s_ is +1𝕧 or -1𝕧, _m_ is a positive mathematical integer less than 2𝕧52𝕧, and _e_ is -1074𝕧.

+

Note that all the positive and negative mathematical integers whose magnitude is no greater than 253 are representable in the Number type (indeed, the mathematical integer 0 has two representations, *+0* and *-0*).

+

A finite number has an odd significand if it is nonzero and the mathematical integer _m_ used to express it (in one of the two forms shown above) is odd. Otherwise, it has an even significand.

+

In this specification, the phrase “the Number value for _x_” where _x_ represents an exact real mathematical quantity (which might even be an irrational number such as π) means a Number value chosen in the following manner. Consider the set of all finite values of the Number type, with *-0* removed and with two additional values added to it that are not representable in the Number type, namely 2𝕧1024𝕧 (which is +1𝕧 × 2𝕧53𝕧 × 2𝕧971𝕧) and -2𝕧1024𝕧 (which is -1𝕧 × 2𝕧53𝕧 × 2𝕧971𝕧). Choose the member of this set that is closest in value to _x_. If two values of the set are equally close, then the one with an even significand is chosen; for this purpose, the two extra values 2𝕧1024𝕧 and -2𝕧1024𝕧 are considered to have even significands. Finally, if 2𝕧1024𝕧 was chosen, replace it with *+∞*; if -2𝕧1024𝕧 was chosen, replace it with *-∞*; if *+0* was chosen, replace it with *-0* if and only if _x_ is less than zero; any other chosen value is used unchanged. The result is the Number value for _x_. (This procedure corresponds exactly to the behaviour of the IEEE 754-2008 “round to nearest, ties to even” mode.)

Some ECMAScript operators deal only with integers in specific ranges such as -231 through 231-1, inclusive, or in the range 0 through 216-1, inclusive. These operators accept any value of the Number type but first convert each such value to an integer value in the expected range. See the descriptions of the numeric conversion operations in .

@@ -3767,10 +3778,10 @@

Runtime Semantics: MV

The conversion of a String to a Number value is similar overall to the determination of the Number value for a numeric literal (see ), but some of the details are different, so the process for converting a String numeric literal to a value of Number type is given here. This value is determined in two steps: first, a mathematical value (MV) is derived from the String numeric literal; second, this mathematical value is rounded as described below. The MV on any grammar symbol, not provided below, is the MV for that symbol defined in .

Once the exact MV for a String numeric literal has been determined, it is then rounded to a value of the Number type. If the MV is 0, then the rounded value is *+0* unless the first non white space code point in the String numeric literal is `"-"`, in which case the rounded value is *-0*. Otherwise, the rounded value must be the Number value for the MV (in the sense defined in ), unless the literal includes a |StrUnsignedDecimalLiteral| and the literal has more than 20 significant digits, in which case the Number value may be either the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a 0 digit or the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a 0 digit and then incrementing the literal at the 20th digit position. A digit is significant if it is not part of an |ExponentPart| and

@@ -3856,7 +3867,7 @@

ToInt32 ( _argument_ )

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. - 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int_ be the Number value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). 1. Let _int32bit_ be _int_ modulo 232. 1. If _int32bit_ ≥ 231, return _int32bit_ - 232; otherwise return _int32bit_. @@ -3883,7 +3894,7 @@

ToUint32 ( _argument_ )

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. - 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int_ be the Number value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). 1. Let _int32bit_ be _int_ modulo 232. 1. Return _int32bit_. @@ -3913,7 +3924,7 @@

ToInt16 ( _argument_ )

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. - 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int_ be the Number value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). 1. Let _int16bit_ be _int_ modulo 216. 1. If _int16bit_ ≥ 215, return _int16bit_ - 216; otherwise return _int16bit_. @@ -3926,7 +3937,7 @@

ToUint16 ( _argument_ )

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. - 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int_ be the Number value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). 1. Let _int16bit_ be _int_ modulo 216. 1. Return _int16bit_. @@ -3950,7 +3961,7 @@

ToInt8 ( _argument_ )

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. - 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int_ be the Number value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). 1. Let _int8bit_ be _int_ modulo 28. 1. If _int8bit_ ≥ 27, return _int8bit_ - 28; otherwise return _int8bit_. @@ -3963,7 +3974,7 @@

ToUint8 ( _argument_ )

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. - 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int_ be the Number value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). 1. Let _int8bit_ be _int_ modulo 28. 1. Return _int8bit_. @@ -4078,7 +4089,7 @@

NumberToString ( _m_ )

1. If _m_ is *+0* or *-0*, return the String `"0"`. 1. If _m_ is less than zero, return the string-concatenation of `"-"` and ! ToString(-_m_). 1. If _m_ is *+∞*, return the String `"Infinity"`. - 1. Otherwise, let _n_, _k_, and _s_ be integers such that _k_ ≥ 1, 10_k_-1 ≤ _s_ < 10_k_, the Number value for _s_ × 10_n_-_k_ is _m_, and _k_ is as small as possible. Note that _k_ is the number of digits in the decimal representation of _s_, that _s_ is not divisible by 10, and that the least significant digit of _s_ is not necessarily uniquely determined by these criteria. + 1. Otherwise, let _n_, _k_, and _s_ be integers such that _k_ ≥ 1, 10_k_-1 ≤ _s_ < 10_k_, the Number value for 𝕧(_s_) ×𝕧 10𝕧𝕧(_n_)-𝕧𝕧(_k_) is _m_, and _k_ is as small as possible. Note that _k_ is the number of digits in the decimal representation of _s_, that _s_ is not divisible by 10𝕧, and that the least significant digit of _s_ is not necessarily uniquely determined by these criteria. 1. If _k_ ≤ _n_ ≤ 21, return the string-concatenation of: * the code units of the _k_ digits of the decimal representation of _s_ (in order, with no leading zeroes) * _n_-_k_ occurrences of the code unit 0x0030 (DIGIT ZERO) @@ -4118,7 +4129,7 @@

NumberToString ( _m_ )

For implementations that provide more accurate conversions than required by the rules above, it is recommended that the following alternative version of step 5 be used as a guideline:

- 5. Otherwise, let _n_, _k_, and _s_ be integers such that _k_ ≥ 1, 10_k_-1 ≤ _s_ < 10_k_, the Number value for _s_ × 10_n_-_k_ is _m_, and _k_ is as small as possible. If there are multiple possibilities for _s_, choose the value of _s_ for which _s_ × 10_n_-_k_ is closest in value to _m_. If there are two such possible values of _s_, choose the one that is even. Note that _k_ is the number of digits in the decimal representation of _s_ and that _s_ is not divisible by 10. + 5. Otherwise, let _n_, _k_, and _s_ be integers such that _k_ ≥ 1, 10_k_-1 ≤ _s_ < 10_k_, the Number value for 𝕧(_s_) ×𝕧 10𝕧𝕧(_n_)-𝕧𝕧(_k_) is _m_, and _k_ is as small as possible. If there are multiple possibilities for _s_, choose the value of _s_ for which 𝕧(_s_) ×𝕧 10𝕧𝕧(_n_) -𝕧 𝕧(_k_) is closest in value to 𝕧(_m_). If there are two such possible values of _s_, choose the one that is even. Note that _k_ is the number of digits in the decimal representation of _s_ and that _s_ is not divisible by 10𝕧.
@@ -4249,7 +4260,7 @@

CanonicalNumericIndexString ( _argument_ )

ToIndex ( _value_ )

-

The abstract operation ToIndex returns _value_ argument converted to a numeric value if it is a valid integer index value. This abstract operation functions as follows:

+

The abstract operation ToIndex returns _value_ argument converted to a non-negative integer if it is a valid integer index value. This abstract operation functions as follows:

1. If _value_ is *undefined*, then 1. Let _index_ be 0. @@ -10343,31 +10354,31 @@

Static Semantics: MV

The MV of DecimalLiteral :: DecimalIntegerLiteral `.` DecimalDigits is the MV of |DecimalIntegerLiteral| plus (the MV of |DecimalDigits| × 10-_n_), where _n_ is the number of code points in |DecimalDigits|.
  • - The MV of DecimalLiteral :: DecimalIntegerLiteral `.` ExponentPart is the MV of |DecimalIntegerLiteral| × 10_e_, where _e_ is the MV of |ExponentPart|. + The MV of DecimalLiteral :: DecimalIntegerLiteral `.` ExponentPart is the MV of |DecimalIntegerLiteral| × 10𝕧_e_, where _e_ is the MV of |ExponentPart|.
  • - The MV of DecimalLiteral :: DecimalIntegerLiteral `.` DecimalDigits ExponentPart is (the MV of |DecimalIntegerLiteral| plus (the MV of |DecimalDigits| × 10-_n_)) × 10_e_, where _n_ is the number of code points in |DecimalDigits| and _e_ is the MV of |ExponentPart|. + The MV of DecimalLiteral :: DecimalIntegerLiteral `.` DecimalDigits ExponentPart is (the MV of |DecimalIntegerLiteral| plus (the MV of |DecimalDigits| × 10𝕧-𝕧_n_)) × 10𝕧_e_, where _n_ is the mathematical integer number of code points in |DecimalDigits| and _e_ is the MV of |ExponentPart|.
  • - The MV of DecimalLiteral :: `.` DecimalDigits is the MV of |DecimalDigits| × 10-_n_, where _n_ is the number of code points in |DecimalDigits|. + The MV of DecimalLiteral :: `.` DecimalDigits is the MV of |DecimalDigits| × 10𝕧-𝕧_n_, where _n_ is the mathematical integer number of code points in |DecimalDigits|.
  • - The MV of DecimalLiteral :: `.` DecimalDigits ExponentPart is the MV of |DecimalDigits| × 10_e_-_n_, where _n_ is the number of code points in |DecimalDigits| and _e_ is the MV of |ExponentPart|. + The MV of DecimalLiteral :: `.` DecimalDigits ExponentPart is the MV of |DecimalDigits| × 10𝕧_e_-𝕧_n_, where _n_ is the mathematical integer number of code points in |DecimalDigits| and _e_ is the MV of |ExponentPart|.
  • The MV of DecimalLiteral :: DecimalIntegerLiteral is the MV of |DecimalIntegerLiteral|.
  • - The MV of DecimalLiteral :: DecimalIntegerLiteral ExponentPart is the MV of |DecimalIntegerLiteral| × 10_e_, where _e_ is the MV of |ExponentPart|. + The MV of DecimalLiteral :: DecimalIntegerLiteral ExponentPart is the MV of |DecimalIntegerLiteral| × 10𝕧_e_, where _e_ is the MV of |ExponentPart|.
  • - The MV of DecimalIntegerLiteral :: `0` is 0. + The MV of DecimalIntegerLiteral :: `0` is 0𝕧.
  • The MV of DecimalIntegerLiteral :: NonZeroDigit is the MV of |NonZeroDigit|.
  • - The MV of DecimalIntegerLiteral :: NonZeroDigit DecimalDigits is (the MV of |NonZeroDigit| × 10_n_) plus the MV of |DecimalDigits|, where _n_ is the number of code points in |DecimalDigits|. + The MV of DecimalIntegerLiteral :: NonZeroDigit DecimalDigits is (the MV of |NonZeroDigit| × 10𝕧_n_) plus the MV of |DecimalDigits|, where _n_ is the mathematical integer number of code points in |DecimalDigits|.
  • The MV of DecimalDigits :: DecimalDigit is the MV of |DecimalDigit|. @@ -10388,52 +10399,52 @@

    Static Semantics: MV

    The MV of SignedInteger :: `-` DecimalDigits is the negative of the MV of |DecimalDigits|.
  • - The MV of DecimalDigit :: `0` or of HexDigit :: `0` or of OctalDigit :: `0` or of BinaryDigit :: `0` is 0. + The MV of DecimalDigit :: `0` or of HexDigit :: `0` or of OctalDigit :: `0` or of BinaryDigit :: `0` is 0𝕧.
  • - The MV of DecimalDigit :: `1` or of NonZeroDigit :: `1` or of HexDigit :: `1` or of OctalDigit :: `1` or of BinaryDigit :: `1` is 1. + The MV of DecimalDigit :: `1` or of NonZeroDigit :: `1` or of HexDigit :: `1` or of OctalDigit :: `1` or of BinaryDigit :: `1` is 1𝕧.
  • - The MV of DecimalDigit :: `2` or of NonZeroDigit :: `2` or of HexDigit :: `2` or of OctalDigit :: `2` is 2. + The MV of DecimalDigit :: `2` or of NonZeroDigit :: `2` or of HexDigit :: `2` or of OctalDigit :: `2` is 2𝕧.
  • - The MV of DecimalDigit :: `3` or of NonZeroDigit :: `3` or of HexDigit :: `3` or of OctalDigit :: `3` is 3. + The MV of DecimalDigit :: `3` or of NonZeroDigit :: `3` or of HexDigit :: `3` or of OctalDigit :: `3` is 3𝕧.
  • - The MV of DecimalDigit :: `4` or of NonZeroDigit :: `4` or of HexDigit :: `4` or of OctalDigit :: `4` is 4. + The MV of DecimalDigit :: `4` or of NonZeroDigit :: `4` or of HexDigit :: `4` or of OctalDigit :: `4` is 4𝕧.
  • - The MV of DecimalDigit :: `5` or of NonZeroDigit :: `5` or of HexDigit :: `5` or of OctalDigit :: `5` is 5. + The MV of DecimalDigit :: `5` or of NonZeroDigit :: `5` or of HexDigit :: `5` or of OctalDigit :: `5` is 5𝕧.
  • - The MV of DecimalDigit :: `6` or of NonZeroDigit :: `6` or of HexDigit :: `6` or of OctalDigit :: `6` is 6. + The MV of DecimalDigit :: `6` or of NonZeroDigit :: `6` or of HexDigit :: `6` or of OctalDigit :: `6` is 6𝕧.
  • - The MV of DecimalDigit :: `7` or of NonZeroDigit :: `7` or of HexDigit :: `7` or of OctalDigit :: `7` is 7. + The MV of DecimalDigit :: `7` or of NonZeroDigit :: `7` or of HexDigit :: `7` or of OctalDigit :: `7` is 7𝕧.
  • - The MV of DecimalDigit :: `8` or of NonZeroDigit :: `8` or of HexDigit :: `8` is 8. + The MV of DecimalDigit :: `8` or of NonZeroDigit :: `8` or of HexDigit :: `8` is 8𝕧.
  • - The MV of DecimalDigit :: `9` or of NonZeroDigit :: `9` or of HexDigit :: `9` is 9. + The MV of DecimalDigit :: `9` or of NonZeroDigit :: `9` or of HexDigit :: `9` is 9𝕧.
  • - The MV of HexDigit :: `a` or of HexDigit :: `A` is 10. + The MV of HexDigit :: `a` or of HexDigit :: `A` is 10𝕧.
  • - The MV of HexDigit :: `b` or of HexDigit :: `B` is 11. + The MV of HexDigit :: `b` or of HexDigit :: `B` is 11𝕧.
  • - The MV of HexDigit :: `c` or of HexDigit :: `C` is 12. + The MV of HexDigit :: `c` or of HexDigit :: `C` is 12𝕧.
  • - The MV of HexDigit :: `d` or of HexDigit :: `D` is 13. + The MV of HexDigit :: `d` or of HexDigit :: `D` is 13𝕧.
  • - The MV of HexDigit :: `e` or of HexDigit :: `E` is 14. + The MV of HexDigit :: `e` or of HexDigit :: `E` is 14𝕧.
  • - The MV of HexDigit :: `f` or of HexDigit :: `F` is 15. + The MV of HexDigit :: `f` or of HexDigit :: `F` is 15𝕧.
  • The MV of BinaryIntegerLiteral :: `0b` BinaryDigits is the MV of |BinaryDigits|. @@ -10445,7 +10456,7 @@

    Static Semantics: MV

    The MV of BinaryDigits :: BinaryDigit is the MV of |BinaryDigit|.
  • - The MV of BinaryDigits :: BinaryDigits BinaryDigit is (the MV of |BinaryDigits| × 2) plus the MV of |BinaryDigit|. + The MV of BinaryDigits :: BinaryDigits BinaryDigit is (the MV of |BinaryDigits| × 2𝕧) plus the MV of |BinaryDigit|.
  • The MV of OctalIntegerLiteral :: `0o` OctalDigits is the MV of |OctalDigits|. @@ -10457,7 +10468,7 @@

    Static Semantics: MV

    The MV of OctalDigits :: OctalDigit is the MV of |OctalDigit|.
  • - The MV of OctalDigits :: OctalDigits OctalDigit is (the MV of |OctalDigits| × 8) plus the MV of |OctalDigit|. + The MV of OctalDigits :: OctalDigits OctalDigit is (the MV of |OctalDigits| × 8𝕧) plus the MV of |OctalDigit|.
  • The MV of HexIntegerLiteral :: `0x` HexDigits is the MV of |HexDigits|. @@ -10469,10 +10480,10 @@

    Static Semantics: MV

    The MV of HexDigits :: HexDigit is the MV of |HexDigit|.
  • - The MV of HexDigits :: HexDigits HexDigit is (the MV of |HexDigits| × 16) plus the MV of |HexDigit|. + The MV of HexDigits :: HexDigits HexDigit is (the MV of |HexDigits| × 16𝕧) plus the MV of |HexDigit|.
  • -

    Once the exact MV for a numeric literal has been determined, it is then rounded to a value of the Number type. If the MV is 0, then the rounded value is *+0*; otherwise, the rounded value must be the Number value for the MV (as specified in ), unless the literal is a |DecimalLiteral| and the literal has more than 20 significant digits, in which case the Number value may be either the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a `0` digit or the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a `0` digit and then incrementing the literal at the 20th significant digit position. A digit is significant if it is not part of an |ExponentPart| and

    +

    Once the exact MV for a numeric literal has been determined, it is then rounded to a value of the Number type. If the MV is 0𝕧, then the rounded value is *+0*; otherwise, the rounded value must be the Number value for the MV (as specified in ), unless the literal is a |DecimalLiteral| and the literal has more than 20 significant digits, in which case the Number value may be either the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a `0` digit or the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a `0` digit and then incrementing the literal at the 20th significant digit position. A digit is significant if it is not part of an |ExponentPart| and

    • it is not `0`; or @@ -13656,7 +13667,7 @@

      Applying the `*` Operator

      Multiplication of an infinity by a finite nonzero value results in a signed infinity. The sign is determined by the rule already stated above.
    • - In the remaining cases, where neither an infinity nor *NaN* is involved, the product is computed and rounded to the nearest representable value using IEEE 754-2008 round to nearest, ties to even mode. If the magnitude is too large to represent, the result is then an infinity of appropriate sign. If the magnitude is too small to represent, the result is then a zero of appropriate sign. The ECMAScript language requires support of gradual underflow as defined by IEEE 754-2008. + In the remaining cases, where neither an infinity nor *NaN* is involved, the product of the mathematical values of the operands is computed and rounded to the nearest representable value using IEEE 754-2008 round to nearest, ties to even mode. If the magnitude is too large to represent, the result is then an infinity of appropriate sign. If the magnitude is too small to represent, the result is then a zero of appropriate sign. The ECMAScript language requires support of gradual underflow as defined by IEEE 754-2008.
    @@ -13691,7 +13702,7 @@

    Applying the `/` Operator

    Division of a nonzero finite value by a zero results in a signed infinity. The sign is determined by the rule already stated above.
  • - In the remaining cases, where neither an infinity, nor a zero, nor *NaN* is involved, the quotient is computed and rounded to the nearest representable value using IEEE 754-2008 round to nearest, ties to even mode. If the magnitude is too large to represent, the operation overflows; the result is then an infinity of appropriate sign. If the magnitude is too small to represent, the operation underflows and the result is a zero of the appropriate sign. The ECMAScript language requires support of gradual underflow as defined by IEEE 754-2008. + In the remaining cases, where neither an infinity, nor a zero, nor *NaN* is involved, the quotient of the mathematical values of the operands is computed and rounded to the nearest representable value using IEEE 754-2008 round to nearest, ties to even mode. If the magnitude is too large to represent, the operation overflows; the result is then an infinity of appropriate sign. If the magnitude is too small to represent, the operation underflows and the result is a zero of the appropriate sign. The ECMAScript language requires support of gradual underflow as defined by IEEE 754-2008.
  • @@ -13722,7 +13733,7 @@

    Applying the `%` Operator

    If the dividend is a zero and the divisor is nonzero and finite, the result is the same as the dividend.
  • - In the remaining cases, where neither an infinity, nor a zero, nor *NaN* is involved, the floating-point remainder r from a dividend n and a divisor d is defined by the mathematical relation r = n - (d × q) where q is an integer that is negative only if n/d is negative and positive only if n/d is positive, and whose magnitude is as large as possible without exceeding the magnitude of the true mathematical quotient of n and d. r is computed and rounded to the nearest representable value using IEEE 754-2008 round to nearest, ties to even mode. + In the remaining cases, where neither an infinity, nor a zero, nor *NaN* is involved, the floating-point remainder _r_ from a dividend _n_ and a divisor _d_ is defined by the mathematical relation _r_ = 𝕧(_n_) - (𝕧(_d_) × _q_) where _q_ is a mathematical integer that is negative only if 𝕧(_n_) ÷𝕧 𝕧(_d_) is negative and positive only if 𝕧(_n_) ÷𝕧 𝕧(_d_) is positive, and whose magnitude is as large as possible without exceeding 𝕧(_n_) ÷𝕧 𝕧(_d_). The result of the operation is the Number value of _r_.
  • @@ -13852,7 +13863,7 @@

    Applying the Additive Operators to Numbers

    The sum of two nonzero finite values of the same magnitude and opposite sign is *+0*.
  • - In the remaining cases, where neither an infinity, nor a zero, nor *NaN* is involved, and the operands have the same sign or have different magnitudes, the sum is computed and rounded to the nearest representable value using IEEE 754-2008 round to nearest, ties to even mode. If the magnitude is too large to represent, the operation overflows and the result is then an infinity of appropriate sign. The ECMAScript language requires support of gradual underflow as defined by IEEE 754-2008. + In the remaining cases, where neither an infinity, nor a zero, nor *NaN* is involved, and the operands have the same sign or have different magnitudes, the sum of the mathematical values of the operands is computed and rounded to the nearest representable value using IEEE 754-2008 round to nearest, ties to even mode. If the magnitude is too large to represent, the operation overflows and the result is then an infinity of appropriate sign. The ECMAScript language requires support of gradual underflow as defined by IEEE 754-2008.
  • @@ -24131,7 +24142,7 @@

    parseFloat ( _string_ )

    1. If neither _trimmedString_ nor any prefix of _trimmedString_ satisfies the syntax of a |StrDecimalLiteral| (see ), return *NaN*. 1. Let _numberString_ be the longest prefix of _trimmedString_, which might be _trimmedString_ itself, that satisfies the syntax of a |StrDecimalLiteral|. 1. Let _mathFloat_ be MV of _numberString_. - 1. If _mathFloat_=0, then + 1. If _mathFloat_ = 0𝕧, then 1. If the first code unit of _trimmedString_ is the code unit 0x002D (HYPHEN-MINUS), return *-0*. 1. Return *+0*. 1. Return the Number value for _mathFloat_. @@ -24164,7 +24175,7 @@

    parseInt ( _string_, _radix_ )

    1. If _S_ contains a code unit that is not a radix-_R_ digit, let _Z_ be the substring of _S_ consisting of all code units before the first such code unit; otherwise, let _Z_ be _S_. 1. If _Z_ is empty, return *NaN*. 1. Let _mathInt_ be the mathematical integer value that is represented by _Z_ in radix-_R_ notation, using the letters A-Z and a-z for digits with values 10 through 35. (However, if _R_ is 10 and _Z_ contains more than 20 significant digits, every significant digit after the 20th may be replaced by a 0 digit, at the option of the implementation; and if _R_ is not 2, 4, 8, 10, 16, or 32, then _mathInt_ may be an implementation-dependent approximation to the mathematical integer value that is represented by _Z_ in radix-_R_ notation.) - 1. If _mathInt_ = 0, then + 1. If _mathInt_ = 0𝕧, then 1. If _sign_ = -1, return *-0*. 1. Return *+0*. 1. Let _number_ be the Number value for _mathInt_. @@ -26299,9 +26310,9 @@

    Number.prototype.toExponential ( _fractionDigits_ )

    1. Let _e_ be 0. 1. Else _x_ ≠ 0, 1. If _fractionDigits_ is not *undefined*, then - 1. Let _e_ and _n_ be integers such that 10_f_ ≤ _n_ < 10_f_+1 and for which the exact mathematical value of _n_ × 10_e_-_f_ - _x_ is as close to zero as possible. If there are two such sets of _e_ and _n_, pick the _e_ and _n_ for which _n_ × 10_e_-_f_ is larger. + 1. Let _e_ and _n_ be integers such that 10_f_ ≤ _n_ < 10_f_+1 and for which 𝕧(_n_) ×𝕧 10𝕧𝕧(_e_) -𝕧 𝕧(_n_) - 𝕧(_x_) is as close to zero as possible. If there are two such sets of _e_ and _n_, pick the _e_ and _n_ for which 𝕧(_n_) ×𝕧 10𝕧𝕧(_e_) -𝕧 𝕧(_f_) is larger. 1. Else _fractionDigits_ is *undefined*, - 1. Let _e_, _n_, and _f_ be integers such that _f_ ≥ 0, 10_f_ ≤ _n_ < 10_f_+1, the Number value for _n_ × 10_e_-_f_ is _x_, and _f_ is as small as possible. Note that the decimal representation of _n_ has _f_+1 digits, _n_ is not divisible by 10, and the least significant digit of _n_ is not necessarily uniquely determined by these criteria. + 1. Let _e_, _n_, and _f_ be integers such that _f_ ≥ 0, 10_f_ ≤ _n_ < 10_f_+1, the Number value for 𝕧(_n_) ×𝕧 10𝕧𝕧(_e_) - 𝕧(_f_) is _x_, and _f_ is as small as possible. Note that the decimal representation of _n_ has _f_+1𝕧 digits, _n_ is not divisible by 10, and the least significant digit of _n_ is not necessarily uniquely determined by these criteria. 1. Let _m_ be the String value consisting of the digits of the decimal representation of _n_ (in order, with no leading zeroes). 1. If _f_ ≠ 0, then 1. Let _a_ be the first element of _m_, and let _b_ be the remaining _f_ elements of _m_. @@ -26321,7 +26332,7 @@

    Number.prototype.toExponential ( _fractionDigits_ )

    For implementations that provide more accurate conversions than required by the rules above, it is recommended that the following alternative version of step 10.b.i be used as a guideline:

    - 1. Let _e_, _n_, and _f_ be integers such that _f_ ≥ 0, 10_f_ ≤ _n_ < 10_f_+1, the Number value for _n_ × 10_e_-_f_ is _x_, and _f_ is as small as possible. If there are multiple possibilities for _n_, choose the value of _n_ for which _n_ × 10_e_-_f_ is closest in value to _x_. If there are two such possible values of _n_, choose the one that is even. + 1. Let _e_, _n_, and _f_ be integers such that _f_ ≥ 0, 10_f_ ≤ _n_ < 10_f_+1, the Number value for 𝕧(_n_) ×𝕧 10𝕧𝕧(_e_) - 𝕧𝕧(_f_) is _x_, and _f_ is as small as possible. If there are multiple possibilities for _n_, choose the value of _n_ for which 𝕧(_n_) ×𝕧 10𝕧𝕧(_e_)-𝕧𝕧(_f_) is closest in value to _x_. If there are two such possible values of _n_, choose the one that is even.
    @@ -26345,7 +26356,7 @@

    Number.prototype.toFixed ( _fractionDigits_ )

    1. If _x_ ≥ 1021, then 1. Let _m_ be ! ToString(_x_). 1. Else _x_ < 1021, - 1. Let _n_ be an integer for which the exact mathematical value of _n_ ÷ 10_f_ - _x_ is as close to zero as possible. If there are two such _n_, pick the larger _n_. + 1. Let _n_ be an integer for which 𝕧(_n_) ÷𝕧 10𝕧𝕧(_f_) - 𝕧(_x_) is as close to zero as possible. If there are two such _n_, pick the larger _n_. 1. If _n_ = 0, let _m_ be the String `"0"`. Otherwise, let _m_ be the String value consisting of the digits of the decimal representation of _n_ (in order, with no leading zeroes). 1. If _f_ ≠ 0, then 1. Let _k_ be the length of _m_. @@ -26393,7 +26404,7 @@

    Number.prototype.toPrecision ( _precision_ )

    1. Let _m_ be the String value consisting of _p_ occurrences of the code unit 0x0030 (DIGIT ZERO). 1. Let _e_ be 0. 1. Else _x_ ≠ 0, - 1. Let _e_ and _n_ be integers such that 10_p_-1 ≤ _n_ < 10_p_ and for which the exact mathematical value of _n_ × 10_e_-_p_+1 - _x_ is as close to zero as possible. If there are two such sets of _e_ and _n_, pick the _e_ and _n_ for which _n_ × 10_e_-_p_+1 is larger. + 1. Let _e_ and _n_ be integers such that 10_p_-1 ≤ _n_ < 10_p_ and for which 𝕧(_n_) ×𝕧 10𝕧𝕧(_e_)-𝕧(_p_)+1𝕧 - 𝕧(_x_) is as close to zero as possible. If there are two such sets of _e_ and _n_, pick the _e_ and _n_ for which 𝕧(_n_) ×𝕧 10𝕧𝕧(_e_)-𝕧𝕧(_p_)+1𝕧 is larger. 1. Let _m_ be the String value consisting of the digits of the decimal representation of _n_ (in order, with no leading zeroes). 1. If _e_ < -6 or _e_ ≥ _p_, then 1. Assert: _e_ ≠ 0. @@ -26469,28 +26480,28 @@

    Value Properties of the Math Object

    Math.E

    -

    The Number value for _e_, the base of the natural logarithms, which is approximately 2.7182818284590452354.

    +

    The Number value for _e_𝕧, the base of the natural logarithms, which is approximately 2.7182818284590452354.

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

    Math.LN10

    -

    The Number value for the natural logarithm of 10, which is approximately 2.302585092994046.

    +

    The Number value for the natural logarithm of 10𝕧, which is approximately 2.302585092994046.

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

    Math.LN2

    -

    The Number value for the natural logarithm of 2, which is approximately 0.6931471805599453.

    +

    The Number value for the natural logarithm of 2𝕧, which is approximately 0.6931471805599453.

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

    Math.LOG10E

    -

    The Number value for the base-10 logarithm of _e_, the base of the natural logarithms; this value is approximately 0.4342944819032518.

    +

    The Number value for the base-10 logarithm of _e_𝕧, the base of the natural logarithms; this value is approximately 0.4342944819032518.

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

    The value of `Math.LOG10E` is approximately the reciprocal of the value of `Math.LN10`.

    @@ -26500,7 +26511,7 @@

    Math.LOG10E

    Math.LOG2E

    -

    The Number value for the base-2 logarithm of _e_, the base of the natural logarithms; this value is approximately 1.4426950408889634.

    +

    The Number value for the base-2 logarithm of _e_𝕧, the base of the natural logarithms; this value is approximately 1.4426950408889634.

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

    The value of `Math.LOG2E` is approximately the reciprocal of the value of `Math.LN2`.

    @@ -26510,14 +26521,14 @@

    Math.LOG2E

    Math.PI

    -

    The Number value for π, the ratio of the circumference of a circle to its diameter, which is approximately 3.1415926535897932.

    +

    The Number value for π𝕧, the ratio of the circumference of a circle to its diameter, which is approximately 3.1415926535897932.

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

    Math.SQRT1_2

    -

    The Number value for the square root of ½, which is approximately 0.7071067811865476.

    +

    The Number value for the square root of ½𝕧, which is approximately 0.7071067811865476.

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

    The value of `Math.SQRT1_2` is approximately the reciprocal of the value of `Math.SQRT2`.

    @@ -26527,7 +26538,7 @@

    Math.SQRT1_2

    Math.SQRT2

    -

    The Number value for the square root of 2, which is approximately 1.4142135623730951.

    +

    The Number value for the square root of 2𝕧, which is approximately 1.4142135623730951.

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

    @@ -26807,7 +26818,7 @@

    Math.cbrt ( _x_ )

    Math.ceil ( _x_ )

    -

    Returns the smallest (closest to *-∞*) Number value that is not less than _x_ and is equal to a mathematical integer. If _x_ is already an integer, the result is _x_.

    +

    Returns the smallest (closest to *-∞*) Number value that is not less than _x_ and is an integer. If _x_ is already an integer, the result is _x_.

    • If _x_ is *NaN*, the result is *NaN*. @@ -26943,7 +26954,7 @@

      Math.expm1 ( _x_ )

      Math.floor ( _x_ )

      -

      Returns the greatest (closest to *+∞*) Number value that is not greater than _x_ and is equal to a mathematical integer. If _x_ is already an integer, the result is _x_.

      +

      Returns the greatest (closest to *+∞*) Number value that is not greater than _x_ and is an integer. If _x_ is already an integer, the result is _x_.

      • If _x_ is *NaN*, the result is *NaN*. @@ -27175,7 +27186,7 @@

        Math.random ( )

        Math.round ( _x_ )

        -

        Returns the Number value that is closest to _x_ and is equal to a mathematical integer. If two integer Number values are equally close to _x_, then the result is the Number value that is closer to *+∞*. If _x_ is already an integer, the result is _x_.

        +

        Returns the Number value that is closest to _x_ and is an integer. If two integers are equally close to _x_, then the result is the Number value that is closer to *+∞*. If _x_ is already an integer, the result is _x_.

        • If _x_ is *NaN*, the result is *NaN*. @@ -30084,12 +30095,12 @@

          Static Semantics: Early Errors

          Static Semantics: CapturingGroupNumber

          DecimalEscape :: NonZeroDigit - 1. Return the MV of |NonZeroDigit|. + 1. Return the Number value of the MV of |NonZeroDigit|. DecimalEscape :: NonZeroDigit DecimalDigits - 1. Let _n_ be the number of code points in |DecimalDigits|. - 1. Return (the MV of |NonZeroDigit| × 10_n_) plus the MV of |DecimalDigits|. + 1. Let _n_ be the mathematical integer number of code points in |DecimalDigits|. + 1. Return (the Number value of the MV of |NonZeroDigit| × 10_n_) plus the Number value of the MV of |DecimalDigits|.

          The definitions of “the MV of |NonZeroDigit|” and “the MV of |DecimalDigits|” are in .

          @@ -33922,7 +33933,7 @@

          %TypedArray%.prototype.copyWithin ( _target_, _start_ [ , _end_ ] )

          1. Let _buffer_ be _O_.[[ViewedArrayBuffer]]. 1. If IsDetachedBuffer(_buffer_) is *true*, throw a *TypeError* exception. 1. Let _typedArrayName_ be the String value of _O_.[[TypedArrayName]]. - 1. Let _elementSize_ be the Number value of the Element Size value specified in for _typedArrayName_. + 1. Let _elementSize_ be the Element Size value specified in for _typedArrayName_. 1. Let _byteOffset_ be _O_.[[ByteOffset]]. 1. Let _toByteIndex_ be _to_ × _elementSize_ + _byteOffset_. 1. Let _fromByteIndex_ be _from_ × _elementSize_ + _byteOffset_. @@ -34173,7 +34184,7 @@

          %TypedArray%.prototype.set ( _array_ [ , _offset_ ] )

          1. If IsDetachedBuffer(_targetBuffer_) is *true*, throw a *TypeError* exception. 1. Let _targetLength_ be _target_.[[ArrayLength]]. 1. Let _targetName_ be the String value of _target_.[[TypedArrayName]]. - 1. Let _targetElementSize_ be the Number value of the Element Size value specified in for _targetName_. + 1. Let _targetElementSize_ be the Element Size value specified in for _targetName_. 1. Let _targetType_ be the String value of the Element Type value in for _targetName_. 1. Let _targetByteOffset_ be _target_.[[ByteOffset]]. 1. Let _src_ be ? ToObject(_array_). @@ -34212,11 +34223,11 @@

          %TypedArray%.prototype.set( _typedArray_ [ , _offset_ ] )

          1. If IsDetachedBuffer(_srcBuffer_) is *true*, throw a *TypeError* exception. 1. Let _targetName_ be the String value of _target_.[[TypedArrayName]]. 1. Let _targetType_ be the String value of the Element Type value in for _targetName_. - 1. Let _targetElementSize_ be the Number value of the Element Size value specified in for _targetName_. + 1. Let _targetElementSize_ be the Element Size value specified in for _targetName_. 1. Let _targetByteOffset_ be _target_.[[ByteOffset]]. 1. Let _srcName_ be the String value of _typedArray_.[[TypedArrayName]]. 1. Let _srcType_ be the String value of the Element Type value in for _srcName_. - 1. Let _srcElementSize_ be the Number value of the Element Size value specified in for _srcName_. + 1. Let _srcElementSize_ be the Element Size value specified in for _srcName_. 1. Let _srcLength_ be _typedArray_.[[ArrayLength]]. 1. Let _srcByteOffset_ be _typedArray_.[[ByteOffset]]. 1. If _srcLength_ + _targetOffset_ > _targetLength_, throw a *RangeError* exception. @@ -34279,7 +34290,7 @@

          %TypedArray%.prototype.slice ( _start_, _end_ )

          1. Let _srcBuffer_ be _O_.[[ViewedArrayBuffer]]. 1. If IsDetachedBuffer(_srcBuffer_) is *true*, throw a *TypeError* exception. 1. Let _targetBuffer_ be _A_.[[ViewedArrayBuffer]]. - 1. Let _elementSize_ be the Number value of the Element Size value specified in for _srcType_. + 1. Let _elementSize_ be the Element Size value specified in for _srcType_. 1. NOTE: If _srcType_ and _targetType_ are the same, the transfer must be performed in a manner that preserves the bit-level encoding of the source data. 1. Let _srcByteOffet_ be _O_.[[ByteOffset]]. 1. Let _targetByteIndex_ be _A_.[[ByteOffset]]. @@ -34355,7 +34366,7 @@

          %TypedArray%.prototype.subarray( _begin_, _end_ )

          1. If _relativeEnd_ < 0, let _endIndex_ be max((_srcLength_ + _relativeEnd_), 0); else let _endIndex_ be min(_relativeEnd_, _srcLength_). 1. Let _newLength_ be max(_endIndex_ - _beginIndex_, 0). 1. Let _constructorName_ be the String value of _O_.[[TypedArrayName]]. - 1. Let _elementSize_ be the Number value of the Element Size value specified in for _constructorName_. + 1. Let _elementSize_ be the Element Size value specified in for _constructorName_. 1. Let _srcByteOffset_ be _O_.[[ByteOffset]]. 1. Let _beginByteOffset_ be _srcByteOffset_ + _beginIndex_ × _elementSize_. 1. Let _argumentsList_ be « _buffer_, _beginByteOffset_, _newLength_ ». @@ -34581,7 +34592,7 @@

          _TypedArray_ ( _buffer_ [ , _byteOffset_ [ , _length_ ] ] )

          1. If NewTarget is *undefined*, throw a *TypeError* exception. 1. Let _constructorName_ be the String value of the Constructor Name value specified in for this TypedArray constructor. 1. Let _O_ be ? AllocateTypedArray(_constructorName_, NewTarget, "%TypedArrayPrototype%"). - 1. Let _elementSize_ be the Number value of the Element Size value in for _constructorName_. + 1. Let _elementSize_ be the Element Size value in for _constructorName_. 1. Let _offset_ be ? ToIndex(_byteOffset_). 1. If _offset_ modulo _elementSize_ ≠ 0, throw a *RangeError* exception. 1. If _length_ is present and _length_ is not *undefined*, then @@ -34637,7 +34648,7 @@

          Properties of the _TypedArray_ Constructors

          _TypedArray_.BYTES_PER_ELEMENT

          -

          The value of _TypedArray_.BYTES_PER_ELEMENT is the Number value of the Element Size value specified in for _TypedArray_.

          +

          The value of _TypedArray_.BYTES_PER_ELEMENT is the Element Size value specified in for _TypedArray_.

          This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

          @@ -34657,7 +34668,7 @@

          Properties of _TypedArray_ Prototype Objects

          _TypedArray_.prototype.BYTES_PER_ELEMENT

          -

          The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Number value of the Element Size value specified in for _TypedArray_.

          +

          The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Element Size value specified in for _TypedArray_.

          This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

          @@ -35771,7 +35782,7 @@

          CloneArrayBuffer ( _srcBuffer_, _srcByteOffset_, _srcLength_, _cloneConstruc

          RawBytesToNumber( _type_, _rawBytes_, _isLittleEndian_ )

          The abstract operation RawBytesToNumber takes three parameters, a String _type_, a List _rawBytes_, and a Boolean _isLittleEndian_. This operation performs the following steps:

          - 1. Let _elementSize_ be the Number value of the Element Size value specified in for Element Type _type_. + 1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. 1. If _isLittleEndian_ is *false*, reverse the order of the elements of _rawBytes_. 1. If _type_ is `"Float32"`, then 1. Let _value_ be the byte elements of _rawBytes_ concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2008 binary32 value. @@ -35798,7 +35809,7 @@

          GetValueFromBuffer ( _arrayBuffer_, _byteIndex_, _type_, _isTypedArray_, _or 1. Assert: There are sufficient bytes in _arrayBuffer_ starting at _byteIndex_ to represent a value of _type_. 1. Assert: _byteIndex_ is an integer value ≥ 0. 1. Let _block_ be _arrayBuffer_.[[ArrayBufferData]]. - 1. Let _elementSize_ be the Number value of the Element Size value specified in for Element Type _type_. + 1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. 1. If IsSharedArrayBuffer(_arrayBuffer_) is *true*, then 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. 1. Let _eventList_ be the [[EventList]] field of the element in _execution_.[[EventLists]] whose [[AgentSignifier]] is AgentSignifier(). @@ -35823,7 +35834,7 @@

          NumberToRawBytes( _type_, _value_, _isLittleEndian_ )

          1. Else if _type_ is `"Float64"`, then 1. Let _rawBytes_ be a List containing the 8 bytes that are the IEEE 754-2008 binary64 format encoding of _value_. If _isLittleEndian_ is *false*, the bytes are arranged in big endian order. Otherwise, the bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2008 binary64 format Not-a-Number encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value. 1. Else, - 1. Let _n_ be the Number value of the Element Size specified in for Element Type _type_. + 1. Let _n_ be the Element Size specified in for Element Type _type_. 1. Let _convOp_ be the abstract operation named in the Conversion Operation column in for Element Type _type_. 1. Let _intValue_ be _convOp_(_value_). 1. If _intValue_ ≥ 0, then @@ -35844,7 +35855,7 @@

          SetValueInBuffer ( _arrayBuffer_, _byteIndex_, _type_, _value_, _isTypedArra 1. Assert: _byteIndex_ is an integer value ≥ 0. 1. Assert: Type(_value_) is Number. 1. Let _block_ be _arrayBuffer_.[[ArrayBufferData]]. - 1. Let _elementSize_ be the Number value of the Element Size value specified in for Element Type _type_. + 1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. 1. If _isLittleEndian_ is not present, set _isLittleEndian_ to the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. 1. Let _rawBytes_ be NumberToRawBytes(_type_, _value_, _isLittleEndian_). 1. If IsSharedArrayBuffer(_arrayBuffer_) is *true*, then @@ -35866,7 +35877,7 @@

          GetModifySetValueInBuffer( _arrayBuffer_, _byteIndex_, _type_, _value_, _op_ 1. Assert: _byteIndex_ is an integer value ≥ 0. 1. Assert: Type(_value_) is Number. 1. Let _block_ be _arrayBuffer_.[[ArrayBufferData]]. - 1. Let _elementSize_ be the Number value of the Element Size value specified in for Element Type _type_. + 1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. 1. If _isLittleEndian_ is not present, set _isLittleEndian_ to the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. 1. Let _rawBytes_ be NumberToRawBytes(_type_, _value_, _isLittleEndian_). 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. @@ -36173,7 +36184,7 @@

          GetViewValue ( _view_, _requestIndex_, _isLittleEndian_, _type_ )

          1. If IsDetachedBuffer(_buffer_) is *true*, throw a *TypeError* exception. 1. Let _viewOffset_ be _view_.[[ByteOffset]]. 1. Let _viewSize_ be _view_.[[ByteLength]]. - 1. Let _elementSize_ be the Number value of the Element Size value specified in for Element Type _type_. + 1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. 1. If _getIndex_ + _elementSize_ > _viewSize_, throw a *RangeError* exception. 1. Let _bufferIndex_ be _getIndex_ + _viewOffset_. 1. Return GetValueFromBuffer(_buffer_, _bufferIndex_, _type_, *false*, `"Unordered"`, _isLittleEndian_). @@ -36195,7 +36206,7 @@

          SetViewValue ( _view_, _requestIndex_, _isLittleEndian_, _type_, _value_ ) for Element Type _type_. + 1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. 1. If _getIndex_ + _elementSize_ > _viewSize_, throw a *RangeError* exception. 1. Let _bufferIndex_ be _getIndex_ + _viewOffset_. 1. Return SetValueInBuffer(_buffer_, _bufferIndex_, _type_, _numberValue_, *false*, `"Unordered"`, _isLittleEndian_). @@ -36646,7 +36657,7 @@

          AtomicReadModifyWrite( _typedArray_, _index_, _value_, _op_ )

          1. Let _i_ be ? ValidateAtomicAccess(_typedArray_, _index_). 1. Let _v_ be ? ToInteger(_value_). 1. Let _arrayTypeName_ be _typedArray_.[[TypedArrayName]]. - 1. Let _elementSize_ be the Number value of the Element Size value specified in for _arrayTypeName_. + 1. Let _elementSize_ be the Element Size value specified in for _arrayTypeName_. 1. Let _elementType_ be the String value of the Element Type value in for _arrayTypeName_. 1. Let _offset_ be _typedArray_.[[ByteOffset]]. 1. Let _indexedPosition_ be (_i_ × _elementSize_) + _offset_. @@ -36661,7 +36672,7 @@

          AtomicLoad( _typedArray_, _index_ )

          1. Let _buffer_ be ? ValidateSharedIntegerTypedArray(_typedArray_). 1. Let _i_ be ? ValidateAtomicAccess(_typedArray_, _index_). 1. Let _arrayTypeName_ be _typedArray_.[[TypedArrayName]]. - 1. Let _elementSize_ be the Number value of the Element Size value specified in for _arrayTypeName_. + 1. Let _elementSize_ be the Element Size value specified in for _arrayTypeName_. 1. Let _elementType_ be the String value of the Element Type value in for _arrayTypeName_. 1. Let _offset_ be _typedArray_.[[ByteOffset]]. 1. Let _indexedPosition_ be (_i_ × _elementSize_) + _offset_. @@ -36700,7 +36711,7 @@

          Atomics.compareExchange( _typedArray_, _index_, _expectedValue_, _replacemen 1. Let _elementType_ be the String value of the Element Type value in for _arrayTypeName_. 1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. 1. Let _expectedBytes_ be NumberToRawBytes(_elementType_, _expected_, _isLittleEndian_). - 1. Let _elementSize_ be the Number value of the Element Size value specified in for _arrayTypeName_. + 1. Let _elementSize_ be the Element Size value specified in for _arrayTypeName_. 1. Let _offset_ be _typedArray_.[[ByteOffset]]. 1. Let _indexedPosition_ be (_i_ × _elementSize_) + _offset_. 1. Let `compareExchange` denote a semantic function of two List of byte values arguments that returns the second argument if the first argument is element-wise equal to _expectedBytes_. @@ -36758,7 +36769,7 @@

          Atomics.store( _typedArray_, _index_, _value_ )

          1. Let _i_ be ? ValidateAtomicAccess(_typedArray_, _index_). 1. Let _v_ be ? ToInteger(_value_). 1. Let _arrayTypeName_ be _typedArray_.[[TypedArrayName]]. - 1. Let _elementSize_ be the Number value of the Element Size value specified in for _arrayTypeName_. + 1. Let _elementSize_ be the Element Size value specified in for _arrayTypeName_. 1. Let _elementType_ be the String value of the Element Type value in for _arrayTypeName_. 1. Let _offset_ be _typedArray_.[[ByteOffset]]. 1. Let _indexedPosition_ be (_i_ × _elementSize_) + _offset_.