# % -- a binary operator, usually used for remainder and reduction

• Usage:
x % y

## Description

The usual meaning for this operator is remainder, or normal form with respect to a Gröbner basis.

For integers, the remainder is non-negative.

 i1 : 1232132141242345 % 1000000 o1 = 242345 i2 : (-4)%5 o2 = 1

In polynomial rings, the division algorithm is used.

 i3 : A = ZZ[a,b] o3 = A o3 : PolynomialRing i4 : (3*a^3-a*b-4) % (5*a-b) 3 2 o4 = - 2a + a b - a*b - 4 o4 : A i5 : pseudoRemainder(3*a^3-a*b-4, 5*a-b) 3 2 o5 = 3b - 25b - 500 o5 : A i6 : B = QQ[a,b] o6 = B o6 : PolynomialRing i7 : (3*a^3-a*b-4) % (5*a-b) 3 3 1 2 o7 = ---b - -b - 4 125 5 o7 : B
In more complicated situations, Gröbner bases are usually needed. See methods for normal forms and remainder.

## See also

• remainder -- matrix remainder
• remainder' -- matrix quotient and remainder (opposite)
• pseudoRemainder -- compute the pseudo-remainder
• // -- a binary operator, usually used for quotient

## For the programmer

The object % is .

This operator may be used as a binary operator in an expression like x%y. The user may install binary methods for handling such expressions with code such as

         X % Y := (x,y) -> ...

where X is the class of x and Y is the class of y.