Documentation of 'org.matheclipse.core.expression.Num' Java class
Num
org.matheclipse.core.expression

Class Num

    • Method Detail

      • hierarchy

        public int hierarchy()
        Description copied from interface: IExpr
        A unique integer ID for the implementation of this expression
        Specified by:
        hierarchy in interface IExpr
        Returns:
        a unique integer id for the implementation of this expression
      • isNumEqualInteger

        public boolean isNumEqualInteger(IInteger ii)
                                  throws java.lang.ArithmeticException
        Check if this expression equals an IInteger value. The value of an INum or the value of an IInteger object can be an IInteger value.
        Specified by:
        isNumEqualInteger in interface IExpr
        Overrides:
        isNumEqualInteger in class ExprImpl
        Returns:
        Throws:
        java.lang.ArithmeticException
      • isNumIntValue

        public boolean isNumIntValue()
        Check if this expression represents an int value. The value of an INum object can be an int value.
        Specified by:
        isNumIntValue in interface IExpr
        Specified by:
        isNumIntValue in interface INum
        Overrides:
        isNumIntValue in class ExprImpl
        Returns:
      • isNegative

        public boolean isNegative()
        Test if this object is a negative signed number.
        Specified by:
        isNegative in interface IExpr
        Specified by:
        isNegative in interface ISignedNumber
        Overrides:
        isNegative in class ExprImpl
        Returns:
        true, if this < 0; false in all other case.
      • isPositive

        public boolean isPositive()
        Test if this object is a positive signed number.
        Specified by:
        isPositive in interface IExpr
        Specified by:
        isPositive in interface ISignedNumber
        Overrides:
        isPositive in class ExprImpl
        Returns:
        true, if this > 0; false in all other case.
      • equalsInt

        public boolean equalsInt(int i)
        Description copied from interface: INumber
        Is this number equal an integer number?
        Specified by:
        equalsInt in interface INumber
        Returns:
      • valueOf

        public static double valueOf(java.lang.String chars)
        Parameters:
        chars -
        Returns:
      • valueOf

        public static Num valueOf(double doubleValue)
        Parameters:
        doubleValue -
        Returns:
      • eabs

        public Num eabs()
        Description copied from interface: INumber
        Get the absolute value for a given number
        Specified by:
        eabs in interface INumber
        Returns:
      • plus

        public double plus(double that)
        Parameters:
        that -
        Returns:
      • compareTo

        public int compareTo(double that)
        Parameters:
        that -
        Returns:
      • divide

        public double divide(double that)
        Parameters:
        that -
        Returns:
      • equals

        public boolean equals(java.lang.Object arg0)
        Description copied from interface: Element
        Test if this is equal to b.
        Specified by:
        equals in interface Element<IExpr>
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to b, else false.
      • isSame

        public boolean isSame(IExpr expression,
                              double epsilon)
        Description copied from interface: IExpr
        Test if this expression equals the given expression. If the compared expressions are of the same numeric type, they are equal to a given EPSILON
        Specified by:
        isSame in interface IExpr
        Overrides:
        isSame in class ExprImpl
      • exp

        public double exp()
      • hashCode

        public final int hashCode()
        Description copied from interface: Element
        Hashcode of this Element.
        Specified by:
        hashCode in interface Element<IExpr>
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hashCode.
      • intValue

        public int intValue()
        Description copied from interface: INum
        Returns the value of this number as an int (by simply casting to type int).
        Specified by:
        intValue in interface INum
        Returns:
      • toInt

        public int toInt()
                  throws java.lang.ArithmeticException
        Converts this double value to an int value; unlike INum.intValue() this method raises ArithmeticException if this integer cannot be represented by an int type.
        Specified by:
        toInt in interface INum
        Specified by:
        toInt in interface ISignedNumber
        Returns:
        the numeric value represented by this integer after conversion to type int.
        Throws:
        java.lang.ArithmeticException - if conversion to int is not possible.
      • toLong

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

        public boolean isInfinite()
        Returns:
      • isNaN

        public boolean isNaN()
        Returns:
      • log

        public double log()
        Returns:
      • longValue

        public long longValue()
        Returns:
      • times

        public double times(double that)
        Parameters:
        that -
        Returns:
      • times

        public IExpr times(IExpr that)
        Description copied from interface: IExpr
        Returns the product of this object with the one specified.
        Specified by:
        times in interface IExpr
        Overrides:
        times in class ExprImpl
        Parameters:
        that - the object multiplier.
        Returns:
        this ยท that.
      • pow

        public double pow(double that)
        Parameters:
        that -
        Returns:
      • pow

        public double pow(int exp)
        Parameters:
        exp -
        Returns:
      • inverse

        public 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 MonoidElem<IExpr>
        Specified by:
        inverse in interface IExpr
        Specified by:
        inverse in interface ISignedNumber
        Overrides:
        inverse in class ExprImpl
        Returns:
        ONE / this.
      • sqrt

        public double sqrt()
        Returns:
      • minus

        public double minus(double that)
        Parameters:
        that -
        Returns:
      • getRealPart

        public double getRealPart()
        Specified by:
        getRealPart in interface INum
        Returns:
      • isZero

        public boolean isZero()
        Description copied from interface: IExpr
        Test if this expression equals 0 in symbolic or numeric mode.
        Specified by:
        isZero in interface IExpr
        Specified by:
        isZero in interface ISignedNumber
        Overrides:
        isZero in class ExprImpl
      • isOne

        public boolean isOne()
        Description copied from interface: IExpr
        Test if this expression equals 1 in symbolic or numeric mode.
        Specified by:
        isOne in interface IExpr
        Overrides:
        isOne in class ExprImpl
      • isMinusOne

        public boolean isMinusOne()
        Description copied from interface: IExpr
        Test if this expression equals -1 in symbolic or numeric mode.
        Specified by:
        isMinusOne in interface IExpr
        Overrides:
        isMinusOne in class ExprImpl
      • round

        public IInteger round()
        Description copied from interface: ISignedNumber
        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.
        Specified by:
        round in interface ISignedNumber
        Returns:
        the closest integer to the argument.
      • sign

        public int sign()
        Description copied from interface: ISignedNumber
        Returns the signum function of this number (i.e., -1, 0 or 1 as the value of this number is negative, zero or positive).
        Specified by:
        sign in interface ISignedNumber
        Returns:
        -1 if this is a negative number;
        0 if this is a zero;
        -1 if this is a negative number;
      • complexSign

        public int complexSign()
        Gets the signum value of a complex number
        Specified by:
        complexSign in interface INumber
        Returns:
        0 for this == 0; +1 for real(this) > 0 or ( real(this)==0 && imaginary(this) > 0 ); -1 for real(this) < 0 || ( real(this) == 0 && imaginary(this) < 0 )
      • ceil

        public IInteger ceil()
        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.
        Specified by:
        ceil in interface ISignedNumber
        Returns:
        the smallest (closest to negative infinity) IInteger value that is not less than this and is equal to a mathematical integer.
      • floor

        public IInteger floor()
        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.
        Specified by:
        floor in interface ISignedNumber
        Returns:
        the largest (closest to positive infinity) IInteger value that is not greater than this and is equal to a mathematical integer.
      • compareTo

        public int compareTo(IExpr obj)
        Compares this expression with the specified expression for order. Returns a negative integer, zero, or a positive integer as this expression is canonical less than, equal to, or greater than the specified expression.
        Specified by:
        compareTo in interface Element<IExpr>
        Specified by:
        compareTo in interface java.lang.Comparable<IExpr>
        Specified by:
        compareTo in interface IExpr
        Returns:
        0 if this is equal to b, -1 if this is less then b, else +1.
      • head

        public ISymbol head()
        Description copied from interface: IExpr
        If this object is an instance of IAST get the first element (offset 0) of the IAST list (i.e. get(0) ).
        Specified by:
        head in interface IExpr
        Specified by:
        head in class ExprImpl
        Returns:
        the head of the expression, which must not be null.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • accept

        public <T> T accept(IVisitor<T> visitor)
        Accept a visitor with return type T
        Specified by:
        accept in interface IExpr
      • accept

        public boolean accept(IVisitorBoolean visitor)
        Accept a visitor with return type boolean
        Specified by:
        accept in interface IExpr
      • accept

        public int accept(IVisitorInt visitor)
        Accept a visitor with return type int
        Specified by:
        accept in interface IExpr
        Returns:
      • getIm

        public ISignedNumber getIm()
        Returns the imaginary part of a complex number
        Specified by:
        getIm in interface INumber
        Returns:
        real part
      • getRe

        public ISignedNumber getRe()
        Returns the real part of a complex number
        Specified by:
        getRe in interface INumber
        Returns:
        real part

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.