Skip to content

saturating_add()

Add two numbers, saturating at the 32-bit integer bounds instead of overflowing

Early access 1.8.0

The saturating_add function adds two numbers, saturating at -2,147,483,648 and 2,147,483,647 instead of overflowing.

The syntax is:

saturating_add(
x INT,
y INT
) RETURNS INT
NameTypeDefaultRequiredDescription
xINT-An integer to add to y
yINT-An integer to add to x
ColumnTypeDescription
saturating_addINTThe result of x + y, saturating at the numeric bounds instead of overflowing. The numeric bounds are the upper and lower bounds of the 32-bit signed integers