Uses of Class
org.apache.commons.numbers.fraction.Fraction
Packages that use Fraction
Package
Description
Field-related utilities.
Fraction number type and fraction number formatting.
-
Uses of Fraction in org.apache.commons.numbers.field
Methods in org.apache.commons.numbers.field that return Fraction -
Uses of Fraction in org.apache.commons.numbers.fraction
Fields in org.apache.commons.numbers.fraction declared as FractionModifier and TypeFieldDescriptionstatic final Fraction
Fraction.ONE
A fraction representing "1".static final Fraction
Fraction.ZERO
A fraction representing "0".Methods in org.apache.commons.numbers.fraction that return FractionModifier and TypeMethodDescriptionFraction.abs()
Returns the absolute value of this fraction.Fraction.add
(int value) Adds the specifiedvalue
to this fraction, returning the result in reduced form.Adds the specifiedvalue
to this fraction, returning the result in reduced form.private Fraction
Implements add and subtract using algorithm described in Knuth 4.5.1.Fraction.divide
(int value) Divide this fraction by the passedvalue
, returning the result in reduced form.Divide this fraction by the passedvalue
, returning the result in reduced form.static Fraction
Fraction.from
(double value) Create a fraction given the double value.static Fraction
Fraction.from
(double value, double epsilon, int maxIterations) Create a fraction given the double value and maximum error allowed.static Fraction
Fraction.from
(double value, int maxDenominator) Create a fraction given the double value and maximum denominator.Fraction.multiply
(int value) Multiply this fraction by the passedvalue
, returning the result in reduced form.private Fraction
Fraction.multiply
(int num, int den) Multiply this fraction by the passed fraction decomposed into a numerator and denominator, returning the result in reduced form.Multiply this fraction by the passedvalue
, returning the result in reduced form.Fraction.negate()
static Fraction
Fraction.of
(int num) Create a fraction given the numerator.static Fraction
Fraction.of
(int num, int den) Create a fraction given the numerator and denominator.Fraction.one()
static Fraction
Returns aFraction
instance representing the specified strings
.Fraction.pow
(int exponent) Returns aFraction
whose value isthisexponent
, returning the result in reduced form.Fraction.reciprocal()
Multiplicative inverse.Fraction.subtract
(int value) Subtracts the specifiedvalue
from this fraction, returning the result in reduced form.Subtracts the specifiedvalue
from this fraction, returning the result in reduced form.Fraction.zero()
Methods in org.apache.commons.numbers.fraction with parameters of type FractionModifier and TypeMethodDescriptionAdds the specifiedvalue
to this fraction, returning the result in reduced form.private Fraction
Implements add and subtract using algorithm described in Knuth 4.5.1.int
Compares this object with the specified object for order using the signed magnitude.Divide this fraction by the passedvalue
, returning the result in reduced form.Multiply this fraction by the passedvalue
, returning the result in reduced form.Subtracts the specifiedvalue
from this fraction, returning the result in reduced form.