Interface IrrationalNumber<N extends PositiveInteger>

Type Parameters:
N - the type of the precision
All Superinterfaces:
Comparable<RealNumber>, Number, RealNumber

public non-sealed interface IrrationalNumber<N extends PositiveInteger> extends RealNumber
An IrrationalNumber is a RealNumber that is not a RationalNumber. IrrationalNumbers can not be represented precisely and rely on approximation for computation.
  • Method Details

    • precision

      N precision()
      Returns:
      the precision N
    • isDouble

      default boolean isDouble()
      Description copied from interface: RealNumber
      Determines if this RealNumber's value has the precision of a primitive double
      Specified by:
      isDouble in interface RealNumber
      Returns:
      true if this RealNumber is double precision, false, if BigDecimal precision
    • compareTo

      default int compareTo(RealNumber n)
      Specified by:
      compareTo in interface Comparable<N extends PositiveInteger>
      Specified by:
      compareTo in interface RealNumber
    • context

      default MathContext context()
      Returns the MathContext used for some BigDecimal calculations
      Returns:
      a MathContext