Clamp Method (Single, Single, Single)

Project Mercury API

[This is preliminary documentation and is subject to change.]

Restricts a value to be within a specified range.

Namespace:  ProjectMercury
Assembly:  ProjectMercury (in ProjectMercury.dll) Version: 3.1.0.0

Syntax

C#
public static float Clamp(
	float value,
	float min,
	float max
)
Visual Basic (Declaration)
Public Shared Function Clamp ( _
	value As Single, _
	min As Single, _
	max As Single _
) As Single
Visual C++
public:
static float Clamp(
	float value, 
	float min, 
	float max
)

Parameters

value
Type: System..::.Single
The value to clamp.
min
Type: System..::.Single
The minimum value. If value is less than min, min will be returned.
max
Type: System..::.Single
The maximum value. If value is greater than max, max will be returned.

Return Value

The clamped value.

See Also