Skip to content

Commit

Permalink
Use AO for conveniently creating Decimal128 objects
Browse files Browse the repository at this point in the history
  • Loading branch information
jessealama committed May 30, 2024
1 parent bd76dd0 commit 663f751
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,7 @@ location: https://github.com/tc39/proposal-decimal/
1. If _d_ is *-∞*<sub>𝔻</sub>, return Decimal128ValueToObject(*+∞*<sub>𝔻</sub>).
1. Let _v_ be _d_[0].
1. Let _q_ be _d_[1].
1. Let _n_ be « abs(_v_), _q_ »<sub>𝔻</sub>.
1. Let _N_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Decimal128.prototype%"*, « [[Decimal128Data]] »).
1. Set _N_.[[Decimal128Data]] to _n_.
1. Return _N_.
1. Return Decimal128ValueToObject(« abs(_v_), _q_ »<sub>𝔻</sub>).
</emu-alg>
<emu-note>
<p>This operation follows the specification in Section 5.5.1 of <emu-xref href="#sec-bibliography">IEEE 754-2019</emu-xref>.</p>
Expand All @@ -353,10 +350,7 @@ location: https://github.com/tc39/proposal-decimal/
1. If _d_ is *-∞*<sub>𝔻</sub>, return Decimal128ValueToObject(*+∞*<sub>𝔻</sub>).
1. Let _v_ be _d_[0].
1. Let _q_ be _d_[1].
1. Let _n_ be « -1 × _v_, _q_ »<sub>𝔻</sub>.
1. Let _N_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Decimal128.prototype%"*, « [[Decimal128Data]] »).
1. Set _N_.[[Decimal128Data]] to _n_.
1. Return _N_.
1. Return Decimal128ValueToObject(« -1 × _v_, _q_ »<sub>𝔻</sub>).
</emu-alg>
<emu-note>
<p>This operation follows the specification in Section 5.5.1 of <emu-xref href="#sec-bibliography">IEEE 754-2019</emu-xref>.</p>
Expand Down

0 comments on commit 663f751

Please sign in to comment.