11.7 Fraction Field Elements

Module: sage.rings.fraction_field_element

Author: William Stein (input from David Joyner, David Kohel, and Joe Wetherell)

Module-level Functions

is_FractionFieldElement( x)

Class: FractionFieldElement

class FractionFieldElement

sage: K, x = FractionField(PolynomialRing(Q)).objgen()
sage: K
Fraction Field of Univariate Polynomial Ring in x over Rational Field
sage: loads(K.dumps()) == K
True
sage: f = (x^3 + x)/(17 - x^19); f
(x^3 + x)/(-x^19 + 17)
sage: loads(f.dumps()) == f
True
FractionFieldElement( self, parent, numerator, [denominator=True], [coerce=True], [reduce=1])

Functions: copy,$  $ denominator,$  $ numerator,$  $ reduce,$  $ valuation

valuation( self)

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

Special Functions: __abs__,$  $ __call__,$  $ __cmp__,$  $ __float__,$  $ __int__,$  $ __invert__,$  $ __long__,$  $ __neg__,$  $ __pos__,$  $ __pow__,$  $ __repr__,$  $ _add_,$  $ _div_,$  $ _integer_,$  $ _is_atomic,$  $ _latex_,$  $ _mul_,$  $ _rational_,$  $ _sub_

__call__( self)

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
x1 - 2*x1*x2 + x0
sage: f(1,2,5)
-17
sage: h = f /(x[1] + x[2])
sage: h
(x1 - 2*x1*x2 + x0)/(x2 + x1)
sage: h(1,2,5)
-17/7

_latex_( self)

Return a latex representation of this rational function.

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