ESBSign Routines
Returns the Sign of the Value.

Unit
QESBPCSMath

Overloaded Variants
Function ESBSign(const X: Extended): ShortInt;
Function ESBSign(const X: Int64): ShortInt;
Function ESBSign(const X: LongInt): ShortInt;

Declaration
Function ESBSign(const X: Extended): ShortInt;

Description
-1 if X < 0.

0 if X = 0.

1 if X > 0.

Parameters
Value to process

Category
Arithmetic Routines for Floats
Arithmetic Routines for Integers

Implementation

function ESBSign (const X: Extended): ShortInt;
begin
     if FloatIsNegative (X) then
          Result := -1
     else if FloatIsZero (X) then
          Result := 0
     else
          Result := 1
End;

Declaration
Function ESBSign(const X: Int64): ShortInt;

Implementation

function ESBSign (const X: Int64): ShortInt;
begin
     if X < 0 then
          Result := -1
     else if X = 0 then
          Result := 0
     else
          Result := 1
End;

Declaration
Function ESBSign(const X: LongInt): ShortInt;

Implementation

function ESBSign (const X: LongInt): ShortInt;
begin
     if X < 0 then
          Result := -1
     else if X = 0 then
          Result := 0
     else
          Result := 1
End;


HTML generated by Time2HELP
http://www.time2help.com