---
name: "clamp_t"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/clamp_t"
---

# clamp\_t(9)

return a value clamped to a given range using a given type

## NAME

clamp\_t - return a value clamped to a given range using a given type

## SYNOPSIS

**clamp\_t(***type***,** *val***,** *min***,** *max***);**

## ARGUMENTS

*type*

the type of variable to use

*val*

current value

*min*

minimum allowable value

*max*

maximum allowable value

## DESCRIPTION

This macro does no typechecking and uses temporary variables of type 'type' to make all the comparisons.

## COPYRIGHT
