Skip to content

Commit

Permalink
Editorial: refactor remainder AOs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Sep 27, 2022
1 parent 231f270 commit 2d69aac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,9 @@ <h1>
1. If _d_ is *+0*<sub>𝔽</sub> or _d_ is *-0*<sub>𝔽</sub>, return *NaN*.
1. If _n_ is *+0*<sub>𝔽</sub> or _n_ is *-0*<sub>𝔽</sub>, return _n_.
1. Assert: _n_ and _d_ are finite and non-zero.
1. Let _r_ be ℝ(_n_) - (ℝ(_d_) &times; _q_) where _q_ is an integer that is negative if and only if _n_ and _d_ have opposite sign, and whose magnitude is as large as possible without exceeding the magnitude of ℝ(_n_) / ℝ(_d_).
1. Let _quotient_ be ℝ(_n_) / ℝ(_d_).
1. Let _q_ be the mathematical value whose sign is the sign of _quotient_ and whose magnitude is floor(abs(_quotient_)).
1. Let _r_ be ℝ(_n_) - (ℝ(_d_) &times; _q_).
1. If _r_ is 0 and _n_ &lt; *-0*<sub>𝔽</sub>, return *-0*<sub>𝔽</sub>.
1. Return 𝔽(_r_).
</emu-alg>
Expand Down Expand Up @@ -2369,8 +2371,9 @@ <h1>
<emu-alg>
1. If _d_ is *0*<sub>β„€</sub>, throw a *RangeError* exception.
1. If _n_ is *0*<sub>β„€</sub>, return *0*<sub>β„€</sub>.
1. Let _r_ be the BigInt defined by the mathematical relation _r_ = _n_ - (_d_ &times; _q_) where _q_ is a BigInt that is negative only if _n_/_d_ is negative and positive only if _n_/_d_ is positive, and whose magnitude is as large as possible without exceeding the magnitude of the true mathematical quotient of _n_ and _d_.
1. Return _r_.
1. Let _quotient_ be ℝ(_n_) / ℝ(_d_).
1. Let _q_ be the BigInt whose sign is the sign of _quotient_ and whose magnitude is floor(abs(_quotient_)).
1. Return _n_ - (_d_ &times; _q_).
</emu-alg>
<emu-note>The sign of the result equals the sign of the dividend.</emu-note>
</emu-clause>
Expand Down

0 comments on commit 2d69aac

Please sign in to comment.