Calculate expressions

Tools tab > Utilities group >  (Calculate), EVAL

With this function, you can calculate user-defined expressions.

An expression may contain numbers, basic arithmetical functions, parentheses, and all mathematical functions in the K programming language. 

  • Basic arithmetical operators:

    + add

    - subtract

    * multiply

    / divide

  • Logical operators:

    && AND

    || OR

    ! NOT

  • Bit operators (integers only):

    ~ complement

    & AND

    | OR

    ^ exclusive OR

    << shift left

    >> shift right

  • Relational operators:

    == equal

    != not equal

    <= less than or equal to

    >= greater than or equal to

    < less than

    > greater than

  • String function: mid(sa,ia1,ia2) returns ia1 characters from string sa starting from character number ia2.

You can also use the system variables from USERR0 to USERR9 reserved for users. You can save the result into a system variable or use their values in the expression. Bear in mind, however, that certain applications use these system variables.

Tip: You can enter an expression whenever the program expects a value. The expression has to be in parentheses. E.g. when the program expects an angle value, you can enter (12*2.5), which will result in an angle entry of 30.