System.Math.EnsureRange
Delphi
function EnsureRange(const AValue, AMin, AMax: Integer): Integer;
function EnsureRange(const AValue, AMin, AMax: Int64): Int64;
function EnsureRange(const AValue, AMin, AMax: UInt64): UInt64;
function EnsureRange(const AValue, AMin, AMax: Single): Single;
function EnsureRange(const AValue, AMin, AMax: Double): Double;
function EnsureRange(const AValue, AMin, AMax: Extended): Extended;
C++
extern DELPHI_PACKAGE int __fastcall EnsureRange(const int AValue, const int AMin, const int AMax)/* overload */;
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
function | public | System.Math.pas System.Math.hpp |
System.Math | System.Math |
説明
指定された範囲内にあり指定された値に最も近い値を返します。
EnsureRange は、指定された範囲内に必ずある値を返します。
AValue は、範囲内にある限り希望する値です。AValue が範囲内にある場合、EnsureRange は AValue を返します。
AMin は許容される最小の値です。AValue が AMin より小さい場合、EnsureRange は AMin を返します。
AMax は許容される最大の値です。AValue が AMax より大きい場合、EnsureRange は AMax を返します。