MathUtilClamp Method (Int32, Int32, Int32) | |
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
The closest value to a specified integer that falls within a specified range.
Namespace:
Telogis.GeoBase
Assembly:
geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax public static int Clamp(
int x,
int minValue,
int maxValue
)
Public Shared Function Clamp (
x As Integer,
minValue As Integer,
maxValue As Integer
) As Integer
Parameters
- x
- Type: SystemInt32
The integer to clamp. - minValue
- Type: SystemInt32
The minimum value that can be returned. - maxValue
- Type: SystemInt32
The maximum value that can be returned.
Return Value
Type:
Int32If x lies between minValue and maxValue, the result is x. Otherwise,
the value is minValue if x is less than minValue, or maxValue if x is greater than maxValue.
See Also