Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: refactor remainder AOs #2911

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,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 @@ -2409,8 +2411,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