Skip to content

Commit b65c65b

Browse files
committed
Normative: ToInteger normalizes -0 to +0 (#1827)
Fixes #1637. This only has an observable impact on `Atomics.store`.
1 parent b41a832 commit b65c65b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

spec.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4801,8 +4801,8 @@ <h1>ToInteger ( _argument_ )</h1>
48014801
<p>The abstract operation ToInteger converts _argument_ to an integral Number value. This abstract operation functions as follows:</p>
48024802
<emu-alg>
48034803
1. Let _number_ be ? ToNumber(_argument_).
4804-
1. If _number_ is *NaN*, return *+0*.
4805-
1. If _number_ is *+0*, *-0*, *+&infin;*, or *-&infin;*, return _number_.
4804+
1. If _number_ is *NaN*, *+0*, or *-0*, return *+0*.
4805+
1. If _number_ is *+&infin;*, or *-&infin;*, return _number_.
48064806
1. Return the Number value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)).
48074807
</emu-alg>
48084808
</emu-clause>
@@ -28518,9 +28518,7 @@ <h1>TimeClip ( _time_ )</h1>
2851828518
<emu-alg>
2851928519
1. If _time_ is not finite, return *NaN*.
2852028520
1. If abs(_time_) &gt; 8.64 &times; 10<sup>15</sup>, return *NaN*.
28521-
1. Let _clippedTime_ be ! ToInteger(_time_).
28522-
1. If _clippedTime_ is *-0*, set _clippedTime_ to *+0*.
28523-
1. Return _clippedTime_.
28521+
1. Return ! ToInteger(_time_).
2852428522
</emu-alg>
2852528523
<emu-note>
2852628524
<p>The point of step 4 is that an implementation is permitted a choice of internal representations of time values, for example as a 64-bit signed integer or as a 64-bit floating-point value. Depending on the implementation, this internal representation may or may not distinguish *-0* and *+0*.</p>

0 commit comments

Comments
 (0)