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....



WithinBounds


Unit: SDL_math1
Class: None
Declaration: [1] function WithinBounds (Inval, Boundary1, Boundary2: double): boolean;
[2] function WithinBounds (Inval, Boundary1, Boundary2, Margin: double): boolean;

The function WithinBounds compares the value Inval to the interval which is spanned by the boundaries Boundary1 and Boundary2. It returns a TRUE value if the value Inval lies within the interval. The two boundary values may be exchanged without affecting the result.

Version [2] provides the additional parameter Margin which extends the range of the interval by +/-Margin before comparing Inval to the interval.


Last Update: 2023-Feb-06