The (integer) numerator of the rational number q in reduced form.
The (integer) denominator of the rational number q in reduced form. This will always be a positive integer.
> Numerator(10/-4); -5 > Denominator(10/-4); 2
Returns true if the rational number q is an element of the ring of integers, false otherwise.
The complex conjugate of q, which will be the rational number q itself.
The conjugate of q, which will be the rational number q itself.
The norm (in Q) of q, which will be the rational number q itself.
The trace (in Q) of q, which will be the rational number q itself.
Returns the minimal polynomial of the rational number q, which is the monic linear polynomial with constant coefficient q in a univariate polynomial ring R over the rational field. (If R has not been created before with a name for its indeterminate, $.1-q will be returned.)
The absolute value | q| of a rational number q.
Returns the sign of the rational number q, which is one of the integers -1, 0, 1, corresponding to the cases q<0, q=0, and q>0.
The ceiling of the rational number q, that is, the least integer greater than or equal to q.
The floor of the rational number q, that is, the largest integer less than or equal to q.
This function returns the integer value of the rational number q rounded to the nearest integer. In case of a tie, rounding is done upwards (that is, i + (1/2) is rounded to i + 1, for integers i).
This function returns the integer truncation of the rational number q, that is the integral part of q. Thus the effect is that of rounding towards 0.
Under certain circumstances it is useful to have a partial inverse of
the function psi _m:Q -> Z/mZ of taking residues
modulo m (where the obvious value of psi _m is only defined for rational
numbers with denominator in smallest terms coprime to m); that partial
function is sometimes referred to as `rational reconstruction'. For s in Z/mZ the value of psi ^(-1)(s) is the rational number r for
which psi _m(r)=s and, in addition, both numerator and denominator
of r are bounded by sqrt(m/2); such r does not
always exist, but if r exists it is unique.
RationalReconstruction(s) : RngResElt -> BoolElt, FldRatElt
Given an element s of a ring S of m elements, return a Boolean flag indicating whether or not a rational number r exists such that for the representation r=n/d in minimal terms it holds that n.d^(-1) = s mod m, and both | n| and d are bounded by sqrt(m/2). If the flag is true, the element r is also returned. The ring S is allowed to be a residue class ring Integers(m) or a finite field of prime cardinality p=m: FiniteField(p).In addition, s is allowed to be a matrix over a prime finite field, in which case the existence (and, if possible, value) of a rational reconstruction of the matrix is determined.
The valuation v of the rational number x at the prime p. This is the difference of the valuations of the numerator and denominator of x. The optional second return value is the rational u such that x = p^v u.[Next] [Prev] [_____] [Left] [Up] [Index] [Root]