Skip to content

Operators

OperatorSupported types
+Int, Long, Double, Decimal, String
-, *Int, Long, Double, Decimal
/Int (truncating), Long (truncating), Double, Decimal
%Int, Long

No implicit widening. Both sides must be the same numeric type.

String + <any> is valid: the right-hand side is coerced to String automatically.

"adult (age " + age + ")" // age is an Int. Coerced automatically

==, !=, <, <=, >, >=. Work on all numeric types and on Bool/String for equality.

&&, || (both short-circuit), ! (unary).

- (numeric negation), ! (boolean negation).