Skip to content

Arithmetic operators

NebulaGraph supports the following arithmetic operators.

Name Description
+ Addition operator
- Minus operator
* Multiplication operator
/ Division operator
% Modulo operator
- Changes the sign of the argument

Examples

nebula> RETURN 1+2 AS result;
+--------+
| result |
+--------+
| 3      |
+--------+

nebula> RETURN -10+5 AS result;
+--------+
| result |
+--------+
| -5     |
+--------+

nebula> RETURN (3*8)%5 AS result;
+--------+
| result |
+--------+
| 4      |
+--------+

Last update: July 18, 2023