The behaviour for ZZ--QQ--RR decided in that other thread are taking
quotients over the sub-ring ZZ. More specifically:
if a,b are in ZZ, QQ or RR then it was decided that a % b should
implicitly satisfy:
a == (a//b) * b + a%b
and a//b in ZZ and a%b has norm smaller than b (norm as in euclidean
domain, and some fix to disallow a%b < 0). If we decided instead that
when a,b in QQ then the a//b should be taken in Q, that would imply a//b
= a/b and a%b = 0. The difference is really which ring a//b should be
required to land in.
More generally, if we have a ring R and a subring S, we could introduce
a function //_S and %_S such that for a,b in R then
a == (a //_S b) * b + a %_S b
where (a //_S b) in S and (a %_S b) has norm < |b|. I'm not sure what
the requirements of R and S should be for such functions to exist.
Apart from all the examples with ZZ, QQ and RR, it seems to work for
e.g. R = K(x) and S = K[x] for a field K with |f1/f2| being deg f1 - deg
f2.
It might seem mathematically "arbitrary" to say that // defaults to
//_ZZ according to the above notation, whenever a,b in RR, if the above
holds for a wide variety of R and S.
Best,
Johan
>>>> 1. Should we always have
>>>>
>>>> a == a//b + a%b
--