Skip to content

Commit 297247b

Browse files
committed
Normative: ToInteger normalizes -0 to +0
Fixes #1637. This only has an observable impact on `Atomics.store`.
1 parent cb73c69 commit 297247b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

spec.html

Lines changed: 4 additions & 6 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>
@@ -26256,7 +26256,7 @@ <h1>Function.prototype.bind ( _thisArg_, ..._args_ )</h1>
2625626256
1. If Type(_targetLen_) is not Number, let _L_ be 0.
2625726257
1. Else,
2625826258
1. Set _targetLen_ to ! ToInteger(_targetLen_).
26259-
1. Let _L_ be the larger of 0 and the result of _targetLen_ minus the number of elements of _args_.
26259+
1. Let _L_ be the larger of *+0* and the result of _targetLen_ minus the number of elements of _args_.
2626026260
1. Else, let _L_ be 0.
2626126261
1. Perform ! SetFunctionLength(_F_, _L_).
2626226262
1. Let _targetName_ be ? Get(_Target_, *"name"*).
@@ -28501,9 +28501,7 @@ <h1>TimeClip ( _time_ )</h1>
2850128501
<emu-alg>
2850228502
1. If _time_ is not finite, return *NaN*.
2850328503
1. If abs(_time_) &gt; 8.64 &times; 10<sup>15</sup>, return *NaN*.
28504-
1. Let _clippedTime_ be ! ToInteger(_time_).
28505-
1. If _clippedTime_ is *-0*, set _clippedTime_ to *+0*.
28506-
1. Return _clippedTime_.
28504+
1. Return ! ToInteger(_time_).
2850728505
</emu-alg>
2850828506
<emu-note>
2850928507
<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)