Documentation API of the 'edu.rit.numeric.BigRational' Java class
BigRational
edu.rit.numeric

Class BigRational

  • All Implemented Interfaces:
    Serializable, Comparable<BigRational>


    public class BigRationalextends Numberimplements Comparable<BigRational>
    Class BigRational provides an arbitrary precision rational number. An arbitrary precision rational number is the ratio of two arbitrary precision integers (type java.math.BigInteger). Operations are provided for exact arithmetic with rational numbers.

    A rational number is said to be normalized if GCD(numerator,denominator) = 1. The methods below do not automatically normalize the rational number. Thus, the numerator and denominator tend to get larger and larger as operations are performed on the rational number. To reduce the numerator and denominator to lowest terms again, call the normalize() method. It is up to you to decide whether to normalize the rational number after each operation, or after a series of operations.

    Class BigRational provides the equals() and hashCode() methods, and BigRational objects can be used as keys in hashed data structures. However, BigRational objects are mutable. If a BigRational object is used as a hash key, be sure not to change its value.

    Class BigRational is not multiple thread safe.

    See Also:
    Serialized Form

Warning: You cannot see the full API documentation of this class since the access to the DatMelt documentation for third-party Java classes is denied. Guests can only view jhplot Java API. To view the complete description of this class and its methods, please request the full DataMelt membership.

If you are already a full member, please login to the DataMelt member area before visiting this documentation.