public static TNumeric Clamp<TNumeric>(
TNumeric x,
TNumeric bound1,
TNumeric bound2
)
where TNumeric : struct, new(), INumeric<TNumeric>
Public Shared Function Clamp(Of TNumeric As {Structure, New, INumeric(Of TNumeric)}) (
x As TNumeric,
bound1 As TNumeric,
bound2 As TNumeric
) As TNumeric
public:
generic<typename TNumeric>
where TNumeric : value class, gcnew(), INumeric<TNumeric>
static TNumeric Clamp(
TNumeric x,
TNumeric bound1,
TNumeric bound2
)
static member Clamp :
x : 'TNumeric *
bound1 : 'TNumeric *
bound2 : 'TNumeric -> 'TNumeric when 'TNumeric : struct, new() and INumeric<'TNumeric>
value if bound1 ≤ value ≤ bound2.
-or-
bound1 if value < bound1.
-or-
bound2 if bound2 < value.