6.10.2.1 FractionFieldElement Objects

class FractionFieldElement
FractionFieldElement( parent, numerator, [denominator=True], [coerce=True], [reduce=1])

Instances of class FractionFieldElement have the following methods (in addition to inherited methods and special methods):

copy,$  $ denominator,$  $ numerator,$  $ reduce,$  $ valuation

Further documentation:

valuation( )

Return the valuation of self, assuming that the numerator and denominator have valuation functions defined on them.

sage: x = PolynomialRing(RationalField()).gen()
sage: f = (x**3 + x)/(x**2 - 2*x**3)
sage: f
(x^2 + 1)/(-2*x^2 + x)
sage: f.valuation()
-1

Instances of class FractionFieldElement also have the following special methods:

__abs__,$  $ __call__,$  $ __cmp__,$  $ __float__,$  $ __int__,$  $ __invert__,$  $ __long__,$  $ __neg__,$  $ __pos__,$  $ __pow__,$  $ __repr__,$  $ _add,$  $ _div,$  $ _integer_,$  $ _is_atomic,$  $ _latex_,$  $ _mul,$  $ _rational_,$  $ _sub

Further documentation:

__call__( )

Evaluate the fraction at the given arguments. This assumes that a call function is defined for the numerator and denominator.

sage: x = MPolynomialRing(RationalField(),3).gens()
sage: f = x[0] + x[1] - 2*x[1]*x[2]
sage: f
x_1 - 2*x_1*x_2 + x_0
sage: f(1,2,5)
-17
sage: h = f /(x[1] + x[2])
sage: h
(x_1 - 2*x_1*x_2 + x_0)/(x_2 + x_1)
sage: h(1,2,5)
-17/7

_latex_( )

Return a latex representation of this rational function.

See About this document... for information on suggesting changes.