Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » operators » %
next | previous | forward | backward | up | index | toc

# % -- 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 remainder (opposite)
- pseudoRemainder -- compute the pseudo-remainder
- // -- a binary operator, usually used for quotient

## Ways to use symbol %:

- `CC % CC`
- `CC % QQ`
- `CC % RR`
- `CC % ZZ`
- `Number % GroebnerBasis`
- `Number % Ideal`
- `Number % RingElement`
- `QQ % QQ`
- `QQ % ZZ`
- `RingElement % Number`
- `RR % QQ`
- `RR % RR`
- `RR % ZZ`
- `ZZ % MonomialIdeal`
- `ZZ % ZZ`
- Matrix % GroebnerBasis -- compute the normal form of a ring element or matrix using a Gröbner basis
- `RingElement % GroebnerBasis` -- see Matrix % GroebnerBasis -- compute the normal form of a ring element or matrix using a Gröbner basis
- `Matrix % Ideal` -- see methods for normal forms and remainder -- normal form of ring elements and matrices
- `Matrix % Matrix` -- see methods for normal forms and remainder -- normal form of ring elements and matrices
- `Matrix % Module` -- see methods for normal forms and remainder -- normal form of ring elements and matrices
- `Matrix % MonomialIdeal` -- see methods for normal forms and remainder -- normal form of ring elements and matrices
- `Matrix % RingElement` -- see methods for normal forms and remainder -- normal form of ring elements and matrices
- `RingElement % Ideal` -- see methods for normal forms and remainder -- normal form of ring elements and matrices
- `RingElement % Matrix` -- see methods for normal forms and remainder -- normal form of ring elements and matrices
- `RingElement % MonomialIdeal` -- see methods for normal forms and remainder -- normal form of ring elements and matrices
- `RingElement % RingElement` -- see methods for normal forms and remainder -- normal form of ring elements and matrices
- `Vector % Ideal` -- see methods for normal forms and remainder -- normal form of ring elements and matrices

## For the programmer

The object % is a keyword.

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.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/operators/remainder.m2:175:0.