ISignedNumber
org.matheclipse.core.interfaces

Interface ISignedNumber

    • Method Detail

      • isNegative

        boolean isNegative()
        Test if this number is negative.
        Specified by:
        isNegative in interface IExpr
        Returns:
        true, if this < 0
      • isPositive

        boolean isPositive()
        Test if this number is positive.
        Specified by:
        isPositive in interface IExpr
        Returns:
        true, if this > 0
      • isZero

        boolean isZero()
        Test if this expression equals 0 in symbolic or numeric mode.
        Specified by:
        isZero in interface IExpr
      • divideBy

        ISignedNumber divideBy(ISignedNumber that)
        Divide this signed number by that signed number.
        Parameters:
        that - a signed number
        Returns:
      • subtractFrom

        ISignedNumber subtractFrom(ISignedNumber that)
        Subtract that signed number from this signed number
        Parameters:
        that - a signed number
        Returns:
      • sign

        int sign()
        Returns the signum function of this number (i.e., -1, 0 or 1 as the value of this number is negative, zero or positive).
        Returns:
        -1 if this is a negative number;
        0 if this is a zero;
        -1 if this is a negative number;
      • toInt

        int toInt()          throws ArithmeticException
        Converts this number to int; unlike #intValue this method raises ArithmeticException if this number cannot be represented by an int type.
        Returns:
        the numeric value represented by this integer after conversion to type int.
        Throws:
        ArithmeticException - if conversion to int is not possible.
      • toLong

        long toLong()            throws ArithmeticException
        Converts this number to long; unlike #longValue this method raises ArithmeticException if this number cannot be represented by an long type.
        Returns:
        the numeric value represented by this integer after conversion to type long.
        Throws:
        ArithmeticException - if conversion to int is not possible.
      • ceil

        IInteger ceil()              throws ArithmeticException
        Returns the smallest (closest to negative infinity) IInteger value that is not less than this and is equal to a mathematical integer. This method raises ArithmeticException if a numeric value cannot be represented by an long type.
        Returns:
        the smallest (closest to negative infinity) IInteger value that is not less than this and is equal to a mathematical integer.
        Throws:
        ArithmeticException
      • floor

        IInteger floor()               throws ArithmeticException
        Returns the largest (closest to positive infinity) IInteger value that is not greater than this and is equal to a mathematical integer.
        This method raises ArithmeticException if a numeric value cannot be represented by an long type.
        Returns:
        the largest (closest to positive infinity) IInteger value that is not greater than this and is equal to a mathematical integer.
        Throws:
        ArithmeticException
      • round

        IInteger round()
        Returns the closest IInteger to the argument. The result is rounded to an integer by adding 1/2 and taking the floor of the result.
        This method raises ArithmeticException if a numeric value cannot be represented by an long type.
        Returns:
        the closest integer to the argument.
      • inverse

        ISignedNumber inverse()
        Description copied from interface: IExpr
        Returns the multiplicative inverse of this object. It is the object such as this.times(this.inverse()) == ONE , with ONE being the multiplicative identity.
        Specified by:
        inverse in interface IExpr
        Specified by:
        inverse in interface MonoidElem<IExpr>
        Returns:
        ONE / this.
      • doubleValue

        double doubleValue()

SCaVis 1.8 © jWork.org