|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Rational
Representation of a rational number a⁄s ∈ Q.
Q := Quot(Z) := (Z∖{0})-1Z = {a⁄s ¦ a,s∈Z ∧ s≠0}
is the field of fractions
of the ring Z.
A rational number a⁄s ∈ Q with numerator a and denominator s is usually written as
a
s
Rational numbers are a subfield of R, and the smallest subfield of all fields of characteristic 0.
ValueFactory.rational(Integer, Integer)
,
ValueFactory.rational(int, int)
,
ValueFactory.rational(Integer)
,
ValueFactory.rational(int)
,
Fraction
,
"N. Bourbaki, Algebra I.9.4: The field of rational numbers.",
"N. Bourbaki, Algebra I.2.4: Monoid of fractions of a commutative monoid."Field Summary | |
---|---|
static Predicate |
hasType
Checks whether the given number is in the set of rationals and not a subset. |
static Predicate |
isa
Checks whether the given number is in the set of rationals. |
Fields inherited from interface orbital.math.Arithmetic |
---|
numerical |
Method Summary | |
---|---|
Rational |
add(Rational b)
adds two rationals returning a third as a result |
Integer |
denominator()
Returns the denominator component. |
Rational |
divide(Rational b)
divides two rationals returning a third as a result |
Rational |
multiply(Rational b)
multiplies two rationals returning a third as a result |
Integer |
numerator()
Returns the numerator component. |
Rational |
power(Integer b)
Return ab. |
Real |
power(Rational b)
Return ab. |
Rational |
representative()
Get the "canonical" representative (cancelled out and normalized) of the equivalence class of rationals equal to this. |
Rational |
subtract(Rational b)
subtracts two rationals returning a third as a result |
Methods inherited from interface orbital.math.Real |
---|
add, compareTo, divide, doubleValue, floatValue, multiply, power, subtract |
Methods inherited from interface orbital.math.Complex |
---|
add, arg, conjugate, divide, equals, hashCode, im, isInfinite, isNaN, multiply, norm, power, re, subtract |
Methods inherited from interface orbital.math.Arithmetic |
---|
add, divide, equals, inverse, isOne, isZero, minus, multiply, one, power, scale, subtract, toString, valueFactory, zero |
Field Detail |
---|
static final Predicate isa
static final Predicate hasType
Method Detail |
---|
Integer numerator()
Integer denominator()
Rational representative()
Rational add(Rational b)
Rational subtract(Rational b)
Rational multiply(Rational b)
Rational divide(Rational b)
Rational power(Integer b)
Real power(Rational b)
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |