saturating_mul()
Multiply two numbers, saturating at the 32-bit integer bounds instead of overflowing
Early access 1.8.0
The saturating_mul function multiplies two numbers, saturating at -2,147,483,648 and 2,147,483,647 instead of
overflowing.
Arguments
Section titled “Arguments”The syntax is:
saturating_mul( x INT, y INT) RETURNS INT| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| x | INT | - | ✔ | An integer to multiply with y |
| y | INT | - | ✔ | An integer to multiply with x |
Returns
Section titled “Returns”| Column | Type | Description |
|---|---|---|
| saturating_mul | INT | The 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 |