Multiplication of IdealRat
Multiplication of IdealRat
Addition of IdealRat
Addition of IdealRat
Subtraction of IdealRat
Subtraction of IdealRat
Division of IdealRat
.
Division of IdealRat
. We use euclidian division with remainder,
i.e., the property this == (this / that) * that + (this % that)
holds, and this % that >= 0
and
this % that < that.abs
.
TODO: make this more efficient
Returns the absolute value of this IdealRat
Returns the absolute value of this IdealRat
Compares this IdealRat
with the specified IdealRat
Compares this IdealRat
with the specified IdealRat
Compares this IdealRat
with the specified
IdealRat
for equality.
Compares this IdealRat
with the specified
IdealRat
for equality.
Compares this IdealRat
with the specified value for equality.
Compares this IdealRat
with the specified value for equality.
Returns the hash code for this IdealRat
.
Returns the hash code for this IdealRat
.
Returns true
iff this IdealRat
is -one
Returns true
iff this IdealRat
is -one
Returns true
iff this IdealRat
is one
Returns true
iff this IdealRat
is one
Returns true
iff this IdealRat
is one or -one
Returns true
iff this IdealRat
is one or -one
Returns true
iff this IdealRat
is zero
Returns true
iff this IdealRat
is zero
Returns the maximum of this and that
Returns the minimum of this and that
Returns the sign of this IdealRat
, i.e.
Returns the sign of this IdealRat
, i.e.
-1 if it is less than 0,
+1 if it is greater than 0
0 if it is equal to 0
Returns the String
representation of this
IdealRat
.
Returns the String
representation of this
IdealRat
.
Returns a IdealRat
whose value is the negation of this
IdealRat
Returns a IdealRat
whose value is the negation of this
IdealRat
(Since version ) see corresponding Javadoc for more information.
Naive implementation of rational numbers