RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Math.Sign Function

Indicates whether a numeric value is positive, negative, or zero.

Pascal
function Sign(const AValue: Integer): TValueSign; overload;
function Sign(const AValue: Int64): TValueSign; overload;
function Sign(const AValue: Double): TValueSign; overload;
C++
TValueSign Sign(const int AValue);
TValueSign Sign(const Int64 AValue);
TValueSign Sign(const Double AValue);

Use Sign to test the sign of a numeric value. Sign returns 

0 if AValue is zero. 

1 if AValue is greater than zero. 

-1 if AValue is less than zero. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!