> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-poc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# saturating_sub_pos()

> Subtract one number from another, saturating at 0 for the minimum bound

<Icon icon="flask" /> Early access <Icon icon="tag" iconType="duotone" /> Since [1.8.0][toolkit-1.8.0]

The `saturating_sub_pos` function subtracts the second number from the first, saturating at 0 and 2,147,483,647 instead
of overflowing.

## Arguments

The syntax is:

```sql theme={"dark"}
saturating_sub_pos(
  x INT,
  y INT
) RETURNS INT
```

| Name | Type | Default | Required | Description                         |
| ---- | ---- | ------- | -------- | ----------------------------------- |
| x    | INT  | -       | ✔        | An integer for `y` to subtract from |
| y    | INT  | -       | ✔        | An integer to subtract from `x`     |

## Returns

| Column               | Type | Description                                                  |
| -------------------- | ---- | ------------------------------------------------------------ |
| saturating\_sub\_pos | INT  | The result of `x - y`, saturating at 0 for the minimum bound |

[toolkit-1.8.0]: https://github.com/timescale/timescaledb-toolkit/releases/tag/1.8.0
