Skip to content

Commit a41a609

Browse files
committed
Return false when comparing a NaN to anything
1 parent de0e599 commit a41a609

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

β€Žspec.emu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -694,16 +694,16 @@ location: https://github.com/tc39/proposal-decimal/
694694

695695
<emu-clause id="sec-decimal128.prototype.equals">
696696
<h1>Decimal128.prototype.equals ( _x_ )</h1>
697-
<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>
697+
<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>
698698
<p>It performs the following steps when called:</p>
699699
<emu-alg>
700700
1. Let _O_ be the *this* value.
701701
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
702702
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
703703
1. Let _d1_ be _O_.[[Decimal128Data]].
704704
1. Let _d2_ be _x_.[[Decimal128Data]].
705-
1. If _d1_ is *NaN*<sub>𝔻</sub>, return *undefined*.
706-
1. If _d2_ is *NaN*<sub>𝔻</sub>, return *undefined*.
705+
1. If _d1_ is *NaN*<sub>𝔻</sub>, return *false*.
706+
1. If _d2_ is *NaN*<sub>𝔻</sub>, return *false*.
707707
1. If _d1_ is *+∞*<sub>𝔻</sub>, then
708708
1. If _d2_ is *+∞*<sub>𝔻</sub>, return *true*.
709709
1. Otherwise, return *false*.
@@ -721,16 +721,16 @@ location: https://github.com/tc39/proposal-decimal/
721721

722722
<emu-clause id="sec-decimal128.prototype.notequals">
723723
<h1>Decimal128.prototype.notEquals ( _x_ )</h1>
724-
<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>
724+
<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>
725725
<p>It performs the following steps when called:</p>
726726
<emu-alg>
727727
1. Let _O_ be the *this* value.
728728
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
729729
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
730730
1. Let _d1_ be _O_.[[Decimal128Data]].
731731
1. Let _d2_ be _x_.[[Decimal128Data]].
732-
1. If _d1_ is *NaN*<sub>𝔻</sub>, return *undefined*.
733-
1. If _d2_ is *NaN*<sub>𝔻</sub>, return *undefined*.
732+
1. If _d1_ is *NaN*<sub>𝔻</sub>, return *false*.
733+
1. If _d2_ is *NaN*<sub>𝔻</sub>, return *false*.
734734
1. If _d1_ is *+∞*<sub>𝔻</sub>, then
735735
1. If _d2_ is *+∞*<sub>𝔻</sub>, return *false*.
736736
1. Otherwise, return *true*.

0 commit comments

Comments
Β (0)