Next: , Previous: Units, Up: Syntax   [Contents][Index]


4.3 Operators

The normal binary operators of type expr <op> expr, where expr is any expression/variable/constant and <op> is one of '+', '-', '/', '*', '\^' and '**' binary operators perform the usual mathematical operations in addition to error propagation. The comparison operators '<', '>', '=', '!=', '<=', '>=' and the logical operators ||'and &&' have the usual meaning. Apart from the usual operation, the var=expr assignment operator also does the error propagation in the expression on the RHS and assigns it as the error for the variable on the LHS. In addition to this, the assignment operator for partial variables (pvar:=expr) is also defined. This does not propagate the errors on the RHS but instead transfers all the required information for error propagation to the variable on the LHS (see Section Sub-expressions). The result of these assignment statements is the value of the variable on the LHS. Hence expressions like sin(x=0.1pm0.02) are equivalent to x=0.1pm0.02;sin(x). The prefix and postfix operators <op>var and var<op> where <op> is either '++' or '--' and var is any user-defined variable are also defined. These increment or decrement the value of the variables by one. The prefix and postfix operators operate on the variables before and after the variable is further used respectively.

In addition, two operators of type expr.<op> where <op> is either val or rms are also defined. These operators extract the value and the associated (propagated) error in expr which can be any mathematical expression or a variable.