BigInteger.Clamp Method

Constrains a value to the inclusive range defined by a minimum and maximum.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.10.0
C#
public static BigInteger Clamp(
	BigInteger value,
	BigInteger min,
	BigInteger max
)

Parameters

value  BigInteger
The value to constrain.
min  BigInteger
The inclusive minimum.
max  BigInteger
The inclusive maximum.

Return Value

BigInteger
min if value is less than it; max if the value is greater than it; otherwise, value.

Implements

INumber<TSelf>.Clamp(TSelf, TSelf, TSelf)

See Also