Skip to content

M_CodeJam_Ranges_Range_1_Clamp

Andrew Koryavchenko edited this page Jun 17, 2018 · 1 revision

Range(T).Clamp Method

Ensures that the value fits into a range.

Namespace: CodeJam.Ranges
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public T Clamp(
	T value
)

VB

Public Function Clamp ( 
	value As T
) As T

F#

member Clamp : 
        value : 'T -> 'T 

Parameters

 

value
Type: T
The value to be adjusted.

Return Value

Type: T
A new value that fits into a range specified

Exceptions

 

Exception Condition
ArgumentException The range is empty or any of its boundaries is exclusive.

See Also

Reference

Range(T) Structure
CodeJam.Ranges Namespace

Clone this wiki locally