---
name: "SDL_min"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_min"
---

# SDL\_min(3)

Return the lesser of two values.

## NAME

SDL\_min - Return the lesser of two values.

## HEADER FILE

Defined in SDL3/SDL\_stdinc.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**#define SDL\_min(x, y) (((x) \< (y)) ? (x) : (y))**

## DESCRIPTION

This is a helper macro that might be more clear than writing out the comparisons directly, and works with any type that can be compared with the **\<** operator. However, it double-evaluates both its parameters, so do not use expressions with side-effects here.

## RETURN VALUE

Returns the lesser of **x** and **y** .

## THREAD SAFETY

It is safe to call this macro from any thread.

## AVAILABILITY

This macro is available since SDL 3.2.0.
