On 4/20/26 20:09, Waldek Hebisch wrote:
>> positiveRemainder : (%, %) -> %
>> ++ positiveRemainder(a, b) (where \spad{b > 1}) yields r
>> ++ where \spad{0 <= r < b} and \spad{r = a rem b}.
> I am tempted to keep
> this as an undocumented extention, that is keep condition 'b > 1'
> in the documentation. The 'r = a rem b' is rather unclear,
> I would rather write 'a = q*b + r'.
Well, I would agree with this 'a = q*b + r' change, but we also have
https://github.com/fricas/fricas/blob/r1.3.13/src/algebra/catdef.spad#L436
divide : (%, %) -> Record(quotient : %, remainder : %)
++ divide(x, y) divides x by y producing a record containing a
++ \spad{quotient} and \spad{remainder},
++ where the remainder is smaller (see
\spadfunFrom{sizeLess?}{EuclideanDomain})
++ than the divisor y.
"quo" : (%,%) -> %
++ x quo y is the same as \spad{divide(x, y).quotient}.
++ See \spadfunFrom{divide}{EuclideanDomain}.
"rem": (%,%) -> %
++ x rem y is the same as \spad{divide(x, y).remainder}.
++ See \spadfunFrom{divide}{EuclideanDomain}.
Unfortunately, even the docstring of divide is similarly vague.
Maybe, we should add 'a = q*b + r' also to the docstring for "divide".
Ralf