* Add and use TValueSign

This commit is contained in:
michael 2021-05-21 08:58:34 +00:00
parent 3447dcfaa6
commit 5ecacbb7a4

View File

@ -57,13 +57,17 @@ function randg(mean,stddev : float) : float;
function RandomRange(const aFrom, aTo: Integer): Integer;
function RandomRange(const aFrom, aTo: NativeLargeInt): NativeLargeInt;
Type
TValueSign = -1..1;
const
NegativeValue = -1;
ZeroValue = 0;
PositiveValue = 1;
function Sign(const AValue: Integer): Integer; external name 'Math.sign'; overload;
function Sign(const AValue: Double): Double; external name 'Math.sign'; overload;
function Sign(const AValue: Integer): TValueSign; external name 'Math.sign'; overload;
function Sign(const AValue: Double): TValueSign; external name 'Math.sign'; overload;
function IsZero(const d: Double; Epsilon: Double): Boolean; overload;
function IsZero(const d: Double): Boolean; overload;