Arithmetic#
CEL supports standard arithmetic operations on numeric types.
Negation#
The unary - operator negates a numeric value.
Negation is not defined for unsigned integers.
Basic operations#
Addition, subtraction, multiplication, and division work on numeric types.
Integer division truncates toward zero.
Modulo#
The % operator returns the remainder after division.
The result has the same sign as the dividend.
Operator precedence#
Multiplication, division, and modulo have higher precedence than addition and subtraction.
Division by zero#
Integer and unsigned integer division by zero produces a runtime error.