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

    Modifier and Type
    Method
    Description
    FractionField.one()
    Return the value of one.
    FractionField.zero()
    Return the value of zero.
  • Uses of Fraction in org.apache.commons.numbers.fraction

    Modifier and Type
    Field
    Description
    static final Fraction
    Fraction.ONE
    A fraction representing "1".
    static final Fraction
    Fraction.ZERO
    A fraction representing "0".
    Modifier and Type
    Method
    Description
    Fraction.abs()
    Returns the absolute value of this fraction.
    Fraction.add(int value)
    Adds the specified value to this fraction, returning the result in reduced form.
    Fraction.add(Fraction value)
    Adds the specified value to this fraction, returning the result in reduced form.
    private Fraction
    Fraction.addSub(Fraction value, boolean isAdd)
    Implements add and subtract using algorithm described in Knuth 4.5.1.
    Fraction.divide(int value)
    Divide this fraction by the passed value, returning the result in reduced form.
    Fraction.divide(Fraction value)
    Divide this fraction by the passed value, 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 passed value, 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.
    Fraction.multiply(Fraction value)
    Multiply this fraction by the passed value, 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
    Fraction.parse(String s)
    Returns a Fraction instance representing the specified string s.
    Fraction.pow(int exponent)
    Returns a Fraction whose value is thisexponent, returning the result in reduced form.
    Fraction.reciprocal()
    Multiplicative inverse.
    Fraction.subtract(int value)
    Subtracts the specified value from this fraction, returning the result in reduced form.
    Fraction.subtract(Fraction value)
    Subtracts the specified value from this fraction, returning the result in reduced form.
    Fraction.zero()
     
    Methods in org.apache.commons.numbers.fraction with parameters of type Fraction
    Modifier and Type
    Method
    Description
    Fraction.add(Fraction value)
    Adds the specified value to this fraction, returning the result in reduced form.
    private Fraction
    Fraction.addSub(Fraction value, boolean isAdd)
    Implements add and subtract using algorithm described in Knuth 4.5.1.
    int
    Fraction.compareTo(Fraction other)
    Compares this object with the specified object for order using the signed magnitude.
    Fraction.divide(Fraction value)
    Divide this fraction by the passed value, returning the result in reduced form.
    Fraction.multiply(Fraction value)
    Multiply this fraction by the passed value, returning the result in reduced form.
    Fraction.subtract(Fraction value)
    Subtracts the specified value from this fraction, returning the result in reduced form.