From 5ecacbb7a49ed811c0bf554902d305a5f1fa7240 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 21 May 2021 08:58:34 +0000 Subject: [PATCH] * Add and use TValueSign --- packages/rtl/math.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/rtl/math.pas b/packages/rtl/math.pas index 1236c54..6f3ef86 100644 --- a/packages/rtl/math.pas +++ b/packages/rtl/math.pas @@ -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;