From d3e5d6b043a874fa03806342da199d4a5a5d1a49 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Wed, 28 Sep 2022 22:50:24 -0700 Subject: [PATCH] Editorial: refactor remainder AOs (#2911) --- spec.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index 6a3cc9ec51..26fa04850e 100644 --- a/spec.html +++ b/spec.html @@ -1985,7 +1985,9 @@

1. If _d_ is *+0*𝔽 or _d_ is *-0*𝔽, return *NaN*. 1. If _n_ is *+0*𝔽 or _n_ is *-0*𝔽, return _n_. 1. Assert: _n_ and _d_ are finite and non-zero. - 1. Let _r_ be ℝ(_n_) - (ℝ(_d_) × _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_) × _q_). 1. If _r_ is 0 and _n_ < *-0*𝔽, return *-0*𝔽. 1. Return 𝔽(_r_). @@ -2409,8 +2411,9 @@

1. If _d_ is *0*, throw a *RangeError* exception. 1. If _n_ is *0*, return *0*. - 1. Let _r_ be the BigInt defined by the mathematical relation _r_ = _n_ - (_d_ × _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_ × _q_). The sign of the result equals the sign of the dividend.