Clamp(T) Method (T, T, T)

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 T Clamp<T>(
	T value,
	T min,
	T max
)
where T : IComparable<T>
Visual Basic (Declaration)
Public Shared Function Clamp(Of T As IComparable(Of T)) ( _
	value As T, _
	min As T, _
	max As T _
) As T
Visual C++
public:
generic<typename T>
where T : IComparable<T>
static T Clamp(
	T value, 
	T min, 
	T max
)

Parameters

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

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:ProjectMercury.Calculator.Clamp``1(``0,``0,``0)"]

Return Value

The clamped value.

See Also