next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: numerator

numerator -- numerator of a fraction

Synopsis

Description

i1 : numerator (4/6)

o1 = 2

i2 : R = frac(ZZ[x,y]);
i3 : numerator((x+2*y-3)/(x-y))

o3 = x + 2y - 3

o3 : ZZ[x, y]

numerator also works with Hilbert series.

i4 : R = QQ[a..d]/(a^2,b^2,c^3);
i5 : hf = hilbertSeries R

           2    3    4     5    7
     1 - 2T  - T  + T  + 2T  - T
o5 = ----------------------------
                      4
               (1 - T)

o5 : Expression of class Divide
i6 : numerator hf

           2    3    4     5    7
o6 = 1 - 2T  - T  + T  + 2T  - T

o6 : ZZ[T]

For a Laurent polynomial in a ring with inverses of variables, it gives the result after clearing all the denominators in each of the terms by multiplying by a suitable monomial.

i7 : R = QQ[x,y,z,Inverses => true, MonomialOrder => Lex]

o7 = R

o7 : PolynomialRing
i8 : numerator (x*y^-1+y*z^-2+1+y^-1*z^-1)

        2    2      2
o8 = x*z  + y  + y*z  + z

o8 : R

See also

Ways to use numerator :