For ring elements in the integers, polynomial rings, and other rings, there are two types of division: exact division, whose result is often in a larger field, such as the rationals or a function field, and division with remainder, whose result is in the same ring. In Macaulay2, '/' denotes the first kind of division, while '//' denotes the latter kind. The following example shows the difference between
// and
/.
i1 : 4/2
o1 = 2
o1 : QQ
|
i2 : 4//2
o2 = 2
|
i3 : R = QQ[x];
|
i4 : (x^2-3)//(x-1)
o4 = x + 1
o4 : R
|
i5 : (x^2-3)%(x-1)
o5 = -2
o5 : R
|
i6 : (x^2-3)/(x-1)
2
x - 3
o6 = ------
x - 1
o6 : frac(R)
|