Example usage for Java org.apache.commons.math3.fraction BigFraction fields, constructors, methods, implement or subclass
The text is from its open source code.
BigFraction | TWO A fraction representing "2 / 1". |
BigFraction | ONE A fraction representing "1". |
BigFraction | ZERO A fraction representing "0". |
BigFraction | MINUS_ONE A fraction representing "-1 / 1". |
BigFraction | ONE_HALF A fraction representing "1/2". |
BigFraction | ONE_THIRD A fraction representing "1/3". |
BigFraction(final BigInteger num) Create a BigFraction equivalent to the passed BigInteger, ie "num / 1". | |
BigFraction(final double value) Create a fraction given the double value. | |
BigFraction(final int num) Create a BigFraction equivalent to the passed int, ie "num / 1". | |
BigFraction(final long num) Create a BigFraction equivalent to the passed long, ie "num / 1". | |
BigFraction(BigInteger num, BigInteger den) Create a BigFraction given the numerator and denominator as BigInteger . | |
BigFraction(final double value, final int maxDenominator) Create a fraction given the double value and maximum denominator. | |
BigFraction(final int num, final int den) Create a BigFraction given the numerator and denominator as simple int. | |
BigFraction(final long num, final long den) Create a BigFraction given the numerator and denominator as simple long. | |
BigFraction(final double value, final double epsilon, final int maxIterations) Create a fraction given the double value and maximum error allowed. |
BigFraction | add(final BigInteger bg) Adds the value of this fraction to the passed BigInteger , returning the result in reduced form. |
BigFraction | add(final int i) Adds the value of this fraction to the passed integer, returning the result in reduced form. |
BigFraction | add(final long l) Adds the value of this fraction to the passed long, returning the result in reduced form. |
BigFraction | add(final BigFraction fraction) Adds the value of this fraction to another, returning the result in reduced form. |
BigDecimal | bigDecimalValue(final int scale, final int roundingMode) Gets the fraction as a |
int | compareTo(final BigFraction object) Compares this object to another based on size. |
BigFraction | divide(final BigInteger bg) Divide the value of this fraction by the passed BigInteger , ie this * 1 / bg , returning the result in reduced form. |
BigFraction | divide(final int i) Divide the value of this fraction by the passed int , ie this * 1 / i , returning the result in reduced form. |
BigFraction | divide(final long l) Divide the value of this fraction by the passed long , ie this * 1 / l , returning the result in reduced form. |
BigFraction | divide(final BigFraction fraction) Divide the value of this fraction by another, returning the result in reduced form. |
double | doubleValue() Gets the fraction as a double. |
boolean | equals(final Object other) Test for the equality of two fractions. |
int | getDenominatorAsInt() Access the denominator as a int. |
long | getDenominatorAsLong() Access the denominator as a long. |
BigInteger | getNumerator() Access the numerator as a |
long | getNumeratorAsLong() Access the numerator as a long. |
BigFraction | multiply(final BigInteger bg) Multiplies the value of this fraction by the passed |
BigFraction | multiply(final int i) Multiply the value of this fraction by the passed int, returning the result in reduced form. |
BigFraction | multiply(final long l) Multiply the value of this fraction by the passed long, returning the result in reduced form. |
BigFraction | multiply(final BigFraction fraction) Multiplies the value of this fraction by another, returning the result in reduced form. |
BigFraction | negate() Return the additive inverse of this fraction, returning the result in reduced form. |
double | percentageValue() Gets the fraction percentage as a double. |
BigFraction | pow(final int exponent) Returns a BigFraction whose value is (thisexponent) , returning the result in reduced form. |
BigFraction | pow(final long exponent) Returns a |
BigFraction | pow(final BigInteger exponent) Returns a |
double | pow(final double exponent) Returns a |
BigFraction | reduce() Reduce this |
BigFraction | subtract(final BigInteger bg) Subtracts the value of an BigInteger from the value of this BigFraction , returning the result in reduced form. |
BigFraction | subtract(final int i) Subtracts the value of an integer from the value of this BigFraction , returning the result in reduced form. |
BigFraction | subtract(final long l) Subtracts the value of a long from the value of this BigFraction , returning the result in reduced form. |
BigFraction | subtract(final BigFraction fraction) Subtracts the value of another fraction from the value of this one, returning the result in reduced form. |
String | toString() Returns the |