Class Rational
java.lang.Object
org.clafer.math.Rational
- All Implemented Interfaces:
Comparable<Rational>
A rational number. Operations throw an
ArithmeticException when the
result does not fit in a long, instead of silently overflowing.- Author:
- jimmy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
Zero
-
One
-
-
Constructor Details
-
Rational
-
Rational
-
-
Method Details
-
getNumerator
-
getDenominator
-
isZero
-
isOne
-
isWhole
-
isPositive
-
isNegative
-
ceil
-
floor
-
minus
-
abs
-
add
-
add
-
sub
-
sub
-
mul
-
mul
-
div
-
div
-
max
-
min
-
isLessThan
-
compareTo
- Specified by:
compareToin interfaceComparable<Rational>
-
equals
-
hashCode
-
toString
-