Skip to content

Mathematical Operators

This section covers mathematical operators. Subsequent sections cover specific mathematical functions.

OperatorFunctionExampleResult
+Addition99+2101
-Subtraction99-297
*Multiplication99*2198
/Division99/2.049.5
%Modulo99 % 21
^Exponentiation99 ^ 29801
|/Square root. See SQRT|/ 999.94
||/Cube root. See CBRT||/ 994.62
&Bitwise AND25 & 2016
|Bitwise OR25 | 2029
#Bitwise XOR25 # 2013
~Bitwise NOT~ 25-26
<<Bitwise shift left25 << 2026214400
>>Bitwise shift right25 >> 200

Note that the division of integers produces different results from the division of decimal values.

The bitwise operators work only with SMALLINT, INTEGER, and BIGINT data types. The other operators work with all numeric data types.

Parent topic:Mathematical Functions