5.24 QuotientMod

QuotientMod( r, s, m )
QuotientMod( R, r, s, m )

In the first form QuotientMod returns the quotient of the ring elements r and s modulo the ring element m in their default ring (see DefaultRing). In the second form QuotientMod returns the quotient of the ring elements r and s modulo the ring element m in the ring R. R must be a Euclidean ring (see IsEuclideanRing) so that EuclideanRemainder (see EuclideanRemainder) can be applied. If the modular quotient does not exist, false is returned.

The quotient q of r and s modulo m is an element of R such that q s = r modulo m, i.e., such that q s - r is divisable by m in R and that q is either 0 (if r is divisable by m) or the Euclidean degree of q is strictly smaller than the Euclidean degree of m.

    gap> QuotientMod( Integers, 13, 7, 11 );
    5
    gap> QuotientMod( Integers, 13, 7, 21 );
    false 

QuotientMod calls R.operations.QuotientMod( R, r, s, m ) and returns the value.

The default function called this way is RingOps.QuotientMod, which applies the Euclidean gcd algorithm to compute the gcd g of s and m, together with the representation of this gcd as linear combination in s and m, g = a * s + b * m. The modular quotient exists if and only if r is divisible by g, in which case the quotient is a * Quotient( R, r, g ). This default function is seldom overlaid, because there is seldom a better way to compute the quotient.

Previous Up Top Next
Index

GAP 3.4.4
April 1997