Skip to content

Commit

Permalink
Return false when comparing a NaN to anything
Browse files Browse the repository at this point in the history
  • Loading branch information
jessealama committed Oct 8, 2024
1 parent de0e599 commit a41a609
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -694,16 +694,16 @@ location: https://github.com/tc39/proposal-decimal/

<emu-clause id="sec-decimal128.prototype.equals">
<h1>Decimal128.prototype.equals ( _x_ )</h1>
<p>This method returns either *true*, *false*, or *undefined* according as the current Decimal128 object has the same mathematical value as the given Decimal128 object. The value *undefined* is returned if the current Decimal128 object or the argument is a NaN.</p>
<p>This method returns either *true* or *false* according as the current Decimal128 object has the same mathematical value as the given Decimal128 object. The value *false* is returned if the current Decimal128 object or the argument is a NaN.</p>
<p>It performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
1. Let _d1_ be _O_.[[Decimal128Data]].
1. Let _d2_ be _x_.[[Decimal128Data]].
1. If _d1_ is *NaN*<sub>𝔻</sub>, return *undefined*.
1. If _d2_ is *NaN*<sub>𝔻</sub>, return *undefined*.
1. If _d1_ is *NaN*<sub>𝔻</sub>, return *false*.
1. If _d2_ is *NaN*<sub>𝔻</sub>, return *false*.
1. If _d1_ is *+∞*<sub>𝔻</sub>, then
1. If _d2_ is *+∞*<sub>𝔻</sub>, return *true*.
1. Otherwise, return *false*.
Expand All @@ -721,16 +721,16 @@ location: https://github.com/tc39/proposal-decimal/

<emu-clause id="sec-decimal128.prototype.notequals">
<h1>Decimal128.prototype.notEquals ( _x_ )</h1>
<p>This method returns either *true*, *false*, or *undefined* according as the current Decimal128 object has a different mathematical value as the given Decimal128 object. The value *undefined* is returned if the current Decimal128 object or the argument is a NaN.</p>
<p>This method returns either *true* or *false* according as the current Decimal128 object has a different mathematical value as the given Decimal128 object. The value *false* is returned if the current Decimal128 object or the argument is a NaN.</p>
<p>It performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
1. Let _d1_ be _O_.[[Decimal128Data]].
1. Let _d2_ be _x_.[[Decimal128Data]].
1. If _d1_ is *NaN*<sub>𝔻</sub>, return *undefined*.
1. If _d2_ is *NaN*<sub>𝔻</sub>, return *undefined*.
1. If _d1_ is *NaN*<sub>𝔻</sub>, return *false*.
1. If _d2_ is *NaN*<sub>𝔻</sub>, return *false*.
1. If _d1_ is *+∞*<sub>𝔻</sub>, then
1. If _d2_ is *+∞*<sub>𝔻</sub>, return *false*.
1. Otherwise, return *true*.
Expand Down

0 comments on commit a41a609

Please sign in to comment.