Type:
_NEG: integer -> integer
_NEG: real -> real
Call syntax:
_NEG(x)
-x
Description:
The unary numerical operator "-" realises
reversal of the sign. Unlike in other programming
languages, in SALIERI, unary "-" is not part of
the numerical constants but a real operator. Consequently,
it can be also applied to complex numerical expressions.
In expressions, unary "-" binds stronger than than equality and relational operators, but weaker than "*", "/", "div" and "mod".
Example:
> -1
Result= -1
> --1.69
Result= 1.69
> -3.16 * -5
Result= 15.8
> -(0.815-5.526)
Result= 4.711
See also: Operator "+" (unary), Operators and Expressions.