CLAMP

Table of Contents

CLAMP

Description

Clamps the value of x to be within the inclusive range [lo, hi].

Parameters

NameDirectionDescription
xinThe value to be clamped.
loinThe lower bound of the clamping range.
hiinThe upper bound of the clamping range.

Success

Returns lo if x < lo, hi if x > hi, otherwise x.

Failure

Function cannot fail - always returns a clamped value.

Usage example (Cross-references)

No external code usages found in the scanned files.

Share :

Related Posts

MIN2

MIN2 Description Returns the smaller of two values x and y.

Read More

LVAL

LVAL Description Creates a temporary, addressable l-value from a given expression x.

Read More

MAX2

MAX2 Description Returns the larger of two values x and y.

Read More