Enum MathOperator

  • All Implemented Interfaces:
    Serializable, Comparable<MathOperator>

    public enum MathOperator
    extends Enum<MathOperator>
    Mathematical operators used in the math operation. Behaviour of each operator on the stack is described using notation (before -- after), where "before" represents the stack before execution of the operator and "after" represent the stack after execution.

    The top of the stack is at the right, e.g. in (x1 x2 -- x1-x2), x2 is the element on the top, x1 is the second from the top and (x1-x2) is the top of the frame after the execution.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ABS
      absolute value (x1 -- abs(x1))
      ACOS
      arccosine (x -- acos\(x)) radians
      ACOSH
      hyperbolic arccosine (x -- acosh\(x))
      ASIN
      arcsine (x -- asin\(x)) radians
      ASINH
      hyperbolic arcsine (x -- asinh\(x))
      ATAN
      arctangent (x -- atan\(x)) radians
      ATANH
      hyperbolic arctangent (x -- atanh\(x))
      BITWISE_AND
      bitwise and (x1 x2 -- x1 & x2)
      BITWISE_OR
      bitwise or (x1 x2 -- x1 | x2)
      COS
      cosine (x -- cos\(x)) radians
      COSH
      hyperbolic cosine (x -- cosh\(x))
      DIV
      division (x1 x2 -- x1/x2) An undefined condition exists if x2 is zero
      DROP
      Remove top item from the stack (x -- )
      DUP
      Duplicate top item on the stack (x -- x x)
      EXP
      exponentiation (x -- exp(x))
      FACT
      factorial (x -- x!)
      INV
      inversion (x -- 1/x) An undefined condition exists if x is zero
      LEFT_SHIFT
      bitwise right shift (x1 x2 -- x1 >> x2)
      LN
      natural (base e) logarithm (x -- ln(x)) An undefined condition exists if x is less than or equal to zero
      LOG
      base-10 logarithm (x-- log(x)) An undefined condition exists if x is less than or equal to zero
      MINUS
      subtraction (x1 x2 -- x1-x2)
      MODULO
      unsigned mod (x1 x2 -- x3) Divide x1 by x2, giving the remainder x3; an undefined condition exists if x2 is zero
      OVER
      Duplicate second item to the top of the stack (x1 x2 -- x1 x2 x1)
      PLUS
      addition (x1 x2 -- x1+x2)
      POW
      power function (x1 x2 -- x1**x2)
      REVPOW
      reverse power function (x1 x2 -- x2**x1)
      RIGHT_SHIFT
      bitwise left shift (x1 x2 -- x1 << x2)
      SIN
      sine (x -- sin\(x)) radians
      SINH
      hyperbolic sine (x -- sinh\(x))
      STAR
      multiplication (x1 x2 -- x1*x2)
      SWAP
      swap the top two stack items (x1 x2 -- x2 x1)
      TAN
      tangent (x -- tan\(x)) radians
      TANH
      hyperbolic tangent (x -- tanh(x))
    • Enum Constant Detail

      • PLUS

        public static final MathOperator PLUS
        addition (x1 x2 -- x1+x2)
      • MINUS

        public static final MathOperator MINUS
        subtraction (x1 x2 -- x1-x2)
      • STAR

        public static final MathOperator STAR
        multiplication (x1 x2 -- x1*x2)
      • DIV

        public static final MathOperator DIV
        division (x1 x2 -- x1/x2) An undefined condition exists if x2 is zero
      • MODULO

        public static final MathOperator MODULO
        unsigned mod (x1 x2 -- x3) Divide x1 by x2, giving the remainder x3; an undefined condition exists if x2 is zero
      • POW

        public static final MathOperator POW
        power function (x1 x2 -- x1**x2)
      • REVPOW

        public static final MathOperator REVPOW
        reverse power function (x1 x2 -- x2**x1)
      • LN

        public static final MathOperator LN
        natural (base e) logarithm (x -- ln(x)) An undefined condition exists if x is less than or equal to zero
      • LOG

        public static final MathOperator LOG
        base-10 logarithm (x-- log(x)) An undefined condition exists if x is less than or equal to zero
      • EXP

        public static final MathOperator EXP
        exponentiation (x -- exp(x))
      • INV

        public static final MathOperator INV
        inversion (x -- 1/x) An undefined condition exists if x is zero
      • FACT

        public static final MathOperator FACT
        factorial (x -- x!) An undefined condition exists if x is less than zero
      • TAN

        public static final MathOperator TAN
        tangent (x -- tan\(x)) radians
      • COS

        public static final MathOperator COS
        cosine (x -- cos\(x)) radians
      • SIN

        public static final MathOperator SIN
        sine (x -- sin\(x)) radians
      • ATAN

        public static final MathOperator ATAN
        arctangent (x -- atan\(x)) radians
      • ACOS

        public static final MathOperator ACOS
        arccosine (x -- acos\(x)) radians
      • ASIN

        public static final MathOperator ASIN
        arcsine (x -- asin\(x)) radians
      • TANH

        public static final MathOperator TANH
        hyperbolic tangent (x -- tanh(x))
      • COSH

        public static final MathOperator COSH
        hyperbolic cosine (x -- cosh\(x))
      • SINH

        public static final MathOperator SINH
        hyperbolic sine (x -- sinh\(x))
      • ATANH

        public static final MathOperator ATANH
        hyperbolic arctangent (x -- atanh\(x))

        An undefined condition exists if x is outside the range [-1.0,+1.0]

      • ACOSH

        public static final MathOperator ACOSH
        hyperbolic arccosine (x -- acosh\(x))

        An undefined condition exists if n is less than one

      • ASINH

        public static final MathOperator ASINH
        hyperbolic arcsine (x -- asinh\(x))
      • SWAP

        public static final MathOperator SWAP
        swap the top two stack items (x1 x2 -- x2 x1)
      • DROP

        public static final MathOperator DROP
        Remove top item from the stack (x -- )
      • DUP

        public static final MathOperator DUP
        Duplicate top item on the stack (x -- x x)
      • OVER

        public static final MathOperator OVER
        Duplicate second item to the top of the stack (x1 x2 -- x1 x2 x1)
      • ABS

        public static final MathOperator ABS
        absolute value (x1 -- abs(x1))
      • LEFT_SHIFT

        public static final MathOperator LEFT_SHIFT
        bitwise right shift (x1 x2 -- x1 >> x2)
      • RIGHT_SHIFT

        public static final MathOperator RIGHT_SHIFT
        bitwise left shift (x1 x2 -- x1 << x2)
      • BITWISE_OR

        public static final MathOperator BITWISE_OR
        bitwise or (x1 x2 -- x1 | x2)
      • BITWISE_AND

        public static final MathOperator BITWISE_AND
        bitwise and (x1 x2 -- x1 & x2)
    • Method Detail

      • values

        public static MathOperator[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MathOperator c : MathOperator.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MathOperator valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getArity

        public int getArity()
      • xtceName

        public String xtceName()