| Package | Description |
|---|---|
| org.sellcom.core.math |
| Modifier and Type | Field | Description |
|---|---|---|
static Fraction |
Fraction.ONE |
Fraction of
1/1. |
static Fraction |
Fraction.ONE_HALF |
Fraction of
1/2. |
static Fraction |
Fraction.ONE_QUARTER |
Fraction of
1/4. |
static Fraction |
Fraction.ONE_THIRD |
Fraction of
1/3. |
static Fraction |
Fraction.THREE_QUARTERS |
Fraction of
3/4. |
static Fraction |
Fraction.TWO_THIRDS |
Fraction of
2/3. |
static Fraction |
Fraction.ZERO |
Fraction of
0/1. |
| Modifier and Type | Method | Description |
|---|---|---|
Fraction |
Fraction.abs() |
Returns the absolute value of this fraction.
|
Fraction |
Fraction.add(int value) |
Returns the sum of this fraction and the given number.
|
Fraction |
Fraction.add(Fraction other) |
Returns the sum of this fraction and the given fraction.
|
Fraction |
Fraction.divide(int value) |
Returns the quotient of this fraction and the given number.
|
Fraction |
Fraction.divide(Fraction other) |
Returns the quotient of this fraction and the given fraction.
|
Fraction |
Fraction.multiply(int value) |
Returns the product of this fraction and the given number.
|
Fraction |
Fraction.multiply(Fraction other) |
Returns the product of this fraction and the given fraction.
|
Fraction |
Fraction.negate() |
Returns the opposite of this fraction.
|
static Fraction |
Fraction.parse(java.lang.String text) |
Returns a fraction obtained from the given text string.
|
Fraction |
Fraction.pow(int exponent) |
Returns this fraction raised to the power of the given exponent.
|
Fraction |
Fraction.reciprocal() |
Return the reciprocal of this fraction.
|
Fraction |
Fraction.subtract(int value) |
Returns the difference of this fraction and the given number.
|
Fraction |
Fraction.subtract(Fraction other) |
Returns the difference of this fraction and the given fraction.
|
static Fraction |
Fraction.valueOf(int value) |
Returns a fraction with the given value.
|
static Fraction |
Fraction.valueOf(int numerator,
int denominator) |
Returns a fraction with the given numerator and denominator.
|
| Modifier and Type | Method | Description |
|---|---|---|
Fraction |
Fraction.add(Fraction other) |
Returns the sum of this fraction and the given fraction.
|
int |
Fraction.compareTo(Fraction other) |
|
Fraction |
Fraction.divide(Fraction other) |
Returns the quotient of this fraction and the given fraction.
|
Fraction |
Fraction.multiply(Fraction other) |
Returns the product of this fraction and the given fraction.
|
Fraction |
Fraction.subtract(Fraction other) |
Returns the difference of this fraction and the given fraction.
|