Skip to content

Commit

Permalink
Normative: ToInteger: fix spec bug from tc39#1827 that allows (-1,0…
Browse files Browse the repository at this point in the history
…) to produce `-0` (tc39#1871)
  • Loading branch information
ljharb committed Feb 15, 2020
1 parent 823aad1 commit b221da8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -4831,7 +4831,9 @@ <h1>ToInteger ( _argument_ )</h1>
1. Let _number_ be ? ToNumber(_argument_).
1. If _number_ is *NaN*, *+0*, or *-0*, return *+0*.
1. If _number_ is *+&infin;*, or *-&infin;*, return _number_.
1. Return the Number value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)).
1. Let _integer_ be floor(abs(_number_)).
1. If ! SameValueZero(_integer_, *+0*), return *+0*.
1. Return the Number value that is the same sign as _number_ and whose magnitude is _integer_.
</emu-alg>
</emu-clause>

Expand Down

0 comments on commit b221da8

Please sign in to comment.