The QQ class represents a rational number, ℚ.
The QQ implementation is that of an immutable (value) type.
The numerator and denominator are reduced to their lowest form.
Construct new instances using the static valueOf method.
valueOf
The denominator of the rational number.
The numerator of the rational number.
this + rhs
this / rhs
Determines whether two rational numbers are equal.
true if this rational number equals the other rational number.
true
this
other
37 * numerator + 13 * denominator
Computes the multiplicative inverse of this rational number.
1 / this
true if this rational number is one (1), otherwise false.
false
true if this rational number is zero (0), otherwise false.
this * rhs
Computes the additive inverse of this rational number.
-this
this - rhs
Computes a non-normative string representation of this rational.
Optional
Static
The rational number numer / denom reduced to its lowest form.
Generated using TypeDoc
The QQ class represents a rational number, ℚ.
The QQ implementation is that of an immutable (value) type.
The numerator and denominator are reduced to their lowest form.
Construct new instances using the static
valueOf
method.