Elementary.Clip Method

Clips a number so that it is within the specified interval.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0
C#
public static double Clip(
	double lowerBound,
	double upperBound,
	double x
)

Parameters

lowerBound  Double
The lower bound of the interval.
upperBound  Double
The upper bound of the interval.
x  Double
A real number.

Return Value

Double
If x is less than or equal to lowerBound, then lowerBound; otherwise, if x is greater than or equal to upperBound, then upperBound; otherwise, x.

See Also