Skip to content

Commit

Permalink
Editorial: make phrasing in RawBytesToNumeric match NumericToRawBytes (
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra authored and ljharb committed Mar 6, 2025
1 parent acf67f9 commit 48925f6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ <h1>Number value</h1>

<emu-clause id="sec-terms-and-definitions-number-type">
<h1>Number type</h1>
<p>set of all possible Number values including the special “Not-a-Number” (NaN) value, positive infinity, and negative infinity</p>
<p>set of all possible Number values including *NaN* (“not a number”), *+∞*<sub>𝔽</sub> (positive infinity), and *-∞*<sub>𝔽</sub> (negative infinity)</p>
</emu-clause>

<emu-clause id="sec-number-object">
Expand All @@ -539,7 +539,7 @@ <h1>Infinity</h1>

<emu-clause id="sec-terms-and-definitions-nan">
<h1>NaN</h1>
<p>Number value that is an IEEE 754-2019 “Not-a-Number” value</p>
<p>Number value that is an IEEE 754-2019 NaN (“not a number”) value</p>
</emu-clause>

<emu-clause id="sec-terms-and-definitions-bigint-value">
Expand Down Expand Up @@ -1968,7 +1968,7 @@ <h1>Numeric Types</h1>

<emu-clause id="sec-ecmascript-language-types-number-type">
<h1>The Number Type</h1>
<p>The <dfn variants="is a Number,is not a Number">Number type</dfn> has exactly 18,437,736,874,454,810,627 (that is, <emu-eqn>2<sup>64</sup> - 2<sup>53</sup> + 3</emu-eqn>) values, representing the double-precision floating point IEEE 754-2019 binary64 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9,007,199,254,740,990 (that is, <emu-eqn>2<sup>53</sup> - 2</emu-eqn>) 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-defined; to ECMAScript code, all *NaN* values are indistinguishable from each other.</p>
<p>The <dfn variants="is a Number,is not a Number">Number type</dfn> has exactly 18,437,736,874,454,810,627 (that is, <emu-eqn>2<sup>64</sup> - 2<sup>53</sup> + 3</emu-eqn>) values, representing the double-precision floating point IEEE 754-2019 binary64 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9,007,199,254,740,990 (that is, <emu-eqn>2<sup>53</sup> - 2</emu-eqn>) distinct NaN 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 NaN values, but such behaviour is implementation-defined; to ECMAScript code, all *NaN* values are indistinguishable from each other.</p>
<emu-note>
<p>The bit pattern that might be observed in an ArrayBuffer (see <emu-xref href="#sec-arraybuffer-objects"></emu-xref>) or a SharedArrayBuffer (see <emu-xref href="#sec-sharedarraybuffer-objects"></emu-xref>) 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.</p>
</emu-note>
Expand Down Expand Up @@ -44346,15 +44346,15 @@ <h1>
1. If _isLittleEndian_ is *false*, reverse the order of the elements of _rawBytes_.
1. If _type_ is ~float16~, then
1. Let _value_ be the byte elements of _rawBytes_ concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2019 binary16 value.
1. If _value_ is an IEEE 754-2019 binary16 NaN value, return the *NaN* Number value.
1. If _value_ is a NaN, return *NaN*.
1. Return the Number value that corresponds to _value_.
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-2019 binary32 value.
1. If _value_ is an IEEE 754-2019 binary32 NaN value, return the *NaN* Number value.
1. If _value_ is a NaN, return *NaN*.
1. Return the Number value that corresponds to _value_.
1. If _type_ is ~float64~, then
1. Let _value_ be the byte elements of _rawBytes_ concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2019 binary64 value.
1. If _value_ is an IEEE 754-2019 binary64 NaN value, return the *NaN* Number value.
1. If _value_ is a NaN, return *NaN*.
1. Return the Number value that corresponds to _value_.
1. If IsUnsignedElementType(_type_) is *true*, then
1. Let _intValue_ be the byte elements of _rawBytes_ concatenated and interpreted as a bit string encoding of an unsigned little-endian binary number.
Expand Down Expand Up @@ -44432,11 +44432,11 @@ <h1>
</dl>
<emu-alg>
1. If _type_ is ~float16~, then
1. Let _rawBytes_ be a List whose elements are the 2 bytes that are the result of converting _value_ to IEEE 754-2019 binary16 format using roundTiesToEven mode. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary16 format Not-a-Number encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value.
1. Let _rawBytes_ be a List whose elements are the 2 bytes that are the result of converting _value_ to IEEE 754-2019 binary16 format using roundTiesToEven mode. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary16 format NaN encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value.
1. Else if _type_ is ~float32~, then
1. Let _rawBytes_ be a List whose elements are the 4 bytes that are the result of converting _value_ to IEEE 754-2019 binary32 format using roundTiesToEven mode. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary32 format Not-a-Number encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value.
1. Let _rawBytes_ be a List whose elements are the 4 bytes that are the result of converting _value_ to IEEE 754-2019 binary32 format using roundTiesToEven mode. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary32 format NaN encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value.
1. Else if _type_ is ~float64~, then
1. Let _rawBytes_ be a List whose elements are the 8 bytes that are the IEEE 754-2019 binary64 format encoding of _value_. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary64 format Not-a-Number encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value.
1. Let _rawBytes_ be a List whose elements are the 8 bytes that are the IEEE 754-2019 binary64 format encoding of _value_. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary64 format NaN encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value.
1. Else,
1. Let _n_ be the Element Size value specified in <emu-xref href="#table-the-typedarray-constructors"></emu-xref> for Element Type _type_.
1. Let _conversionOperation_ be the abstract operation named in the Conversion Operation column in <emu-xref href="#table-the-typedarray-constructors"></emu-xref> for Element Type _type_.
Expand Down

0 comments on commit 48925f6

Please sign in to comment.