On 04/07/2021 17:33, James Harris wrote:
> Thanks for the feedback in the thread about integer division and
> rounding. I've been thinking about how it might all be put into practice
> and that's what I'll go in to, below.
In summary, I would have ten (now eleven) rounding modes and eleven (now
twelve) mnemonic operators for each of division and remainder.
I'm surprised that no one has objected to it. Not sure whether that's
because it's a tedious and fiddly subject (it is) or because people
agreed with the approach. Knowing Usenet it's unlikely to be the latter.
The additions since the earlier post are
diveuc - Euclidean division
remeuc - Euclidean remainder
because ISTM that Euclidean division (and remainder) can be treated as a
Essentially, Euclidean division always produces a non-negative
remainder. In the words of Wikipedia:
0 ≤ r < |b|,
where |b| denotes the absolute value of b.
Have to say I don't like having so many mnemonic operators but I haven't
yet thought of a better solution which is still comprehensive.