---
title: saturating_sub() | Tiger Data Docs
description: Subtract one number from another, saturating at the 32-bit integer bounds instead of overflowing
---

Early access [1.8.0](https://github.com/timescale/timescaledb-toolkit/releases/tag/1.8.0)

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

## Arguments

The syntax is:

```
saturating_sub(
  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 | 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 |
