IMathTNumericClamp Method
Returns value clamped to the inclusive range of bound1 and bound2.
Namespace: Jodosoft.NumericsAssembly: Jodosoft.Numerics (in Jodosoft.Numerics.dll) Version: 2.0
TNumeric Clamp(
TNumeric value,
TNumeric bound1,
TNumeric bound2
)
Function Clamp (
value As TNumeric,
bound1 As TNumeric,
bound2 As TNumeric
) As TNumeric
TNumeric Clamp(
TNumeric value,
TNumeric bound1,
TNumeric bound2
)
abstract Clamp :
value : 'TNumeric *
bound1 : 'TNumeric *
bound2 : 'TNumeric -> 'TNumeric
- value TNumeric
- The value to be clamped.
- bound1 TNumeric
- The first bound of the result (may be the lower or upper bound).
- bound2 TNumeric
- The second bound of the result (may be the lower or upper bound).
TNumericvalue if bound1 ≤ value ≤ bound2.
-or-
bound1 if value < bound1.
-or-
bound2 if bound2 < value.
This method may return
NaN or Infinity.
If
NaN or Infinity cannot be represented by
TNumeric,
then this method may throw an
ArithmeticException.