| MathHelperClampT Method |
Clamps the specified value.
Namespace: DigitalRune.MathematicsAssembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax public static T Clamp<T>(
T value,
T min,
T max
)
where T : Object, IComparable<T>
Public Shared Function Clamp(Of T As {Object, IComparable(Of T)}) (
value As T,
min As T,
max As T
) As T
public:
generic<typename T>
where T : Object, IComparable<T>
static T Clamp(
T value,
T min,
T max
)
static member Clamp :
value : 'T *
min : 'T *
max : 'T -> 'T when 'T : Object and IComparable<'T>
Parameters
- value
- Type: T
The value which should be clamped. - min
- Type: T
The min limit. - max
- Type: T
The max limit.
Type Parameters
- T
- The type of the value.
Return Value
Type:
Tvalue clamped to the interval
[
min,
max].
Remarks
Values within the limits are not changed. Values exceeding the limits are cut off.
See Also