Unary arithmetic operators

Unary arithmetic operators are unary plus (+a) and unary minus (-a) that precede the numeric operand and specify its sign.

 

For unsigned values, the default is positive ( + ).

 

Unary arithmetic operators can be used only with operands of DECIMAL, INTEGER, BIGINT, SMALLINT, TINYINT, FLOAT, SMALLFLOAT, MONEY, and INTERVAL data types.

 

Unary plus and minus operators are recursive.

Parentheses must separate the subtraction operator from an immediately following unary minus because otherwise any piece of code coming after them will be treated as a comment.

Compare:

LET a = -(-b)

and

LET a = --b

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.