Numerical Operators

Table 4-3. Postgres Numerical Operators

OperatorDescriptionUsage
! Factorial3 !
!! Factorial (left operator)!! 3
% Modulo5 % 4
% Truncate% 4.5
* Multiplication2 * 3
+ Addition2 + 3
- Subtraction2 - 3
/ Division4 / 2
: Natural Exponentiation: 3.0
@ Absolute value@ -5.0
^ Exponentiation2.0 ^ 3.0
|/ Square root|/ 25.0
||/ Cube root||/ 27.0

Note: Two operators, ":" and ";", are now deprecated and will be removed in the next release. Use the equivalent functions exp() and ln() instead.