Package | Description |
---|---|
org.uncommons.maths.number |
Custom numeric data types and classes for working with java.lang.Number and
its sub-classes.
|
Modifier and Type | Field and Description |
---|---|
static Rational |
Rational.HALF
Convenient constant representing a value of a half (1/2 as a rational).
|
static Rational |
Rational.ONE
Convenient constant representing a value of one (1/1 as a rational).
|
static Rational |
Rational.QUARTER
Convenient constant representing a value of a quarter (1/4 as a rational).
|
static Rational |
Rational.THIRD
Convenient constant representing a value of a third (1/3 as a rational).
|
static Rational |
Rational.THREE_QUARTERS
Convenient constant representing a value of three quarters (3/4 as a rational).
|
static Rational |
Rational.TWO_THIRDS
Convenient constant representing a value of two thirds (2/3 as a rational).
|
static Rational |
Rational.ZERO
Convenient constant representing a value of zero (0/1 as a rational).
|
Modifier and Type | Method and Description |
---|---|
Rational |
Rational.add(Rational value)
Add the specified value to this value and return the result as a new object
(also a rational).
|
Rational |
Rational.divide(Rational value)
Divide this rational by the specified value and return the result as a new
object (also a Rational).
|
Rational |
Rational.multiply(Rational value)
Multiply this rational by the specified value and return the result as a new
object (also a Rational).
|
Rational |
Rational.subtract(Rational value)
Subtract the specified value from this value and return the result as a new object
(also a rational).
|
Modifier and Type | Method and Description |
---|---|
Rational |
Rational.add(Rational value)
Add the specified value to this value and return the result as a new object
(also a rational).
|
int |
Rational.compareTo(Rational other)
Compares this value with the specified object for order.
|
Rational |
Rational.divide(Rational value)
Divide this rational by the specified value and return the result as a new
object (also a Rational).
|
Rational |
Rational.multiply(Rational value)
Multiply this rational by the specified value and return the result as a new
object (also a Rational).
|
Rational |
Rational.subtract(Rational value)
Subtract the specified value from this value and return the result as a new object
(also a rational).
|
Copyright © 2015. All rights reserved.