The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



ConfineValue


Unit: SDL_math1
Class: None
Declaration: [1] function ConfineValue (Inval: double; Boundary1: double; Boundary2: double): double;
[2] function ConfineValue (Inval: single; Boundary1: single; Boundary2: single): single;
[3] function ConfineValue (Inval: integer; Boundary1: integer; Boundary2: integer): integer;

The function ConfineValue checks whether the value Inval is outside the interval spanned by the parameters Boundary1 and Boundary2. If Inval falls outside the interval the function returns the value of the closest boundary, otherwise Inval is returned.

Hint: The order of the boundaries does not matter.



Last Update: 2023-Feb-06