undocumented features



Jean-Claude ARBAUT <jeanclaudearbaut at orange.fr> writes:
> Ok, 5 and 2 are polynomials of degree 0. But quotient(5, 2) = 2, the
> _integer_ quotient (and I believe it's the only straightforward way to
> get the integer quotient).
>
> Now if you try quotient(5/3, 2), you get 5/6, the polynomial
> quotient. Rather strange, and that makes it very easy to write buggy
> code when working with polynomials : some explanation in the manual
> would be very appreciated !

While this doesn't address the fact that the manual didn't point you to
the right solution (and as such could be improved), I have always used
the remainder function:

(%i1) remainder(5,3);
(%o1)                                  2
(%i2) remainder(5/3,3);
(%o2)                                  0



Rupert