mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 09:29:07 +02:00
* sign() extended and single
git-svn-id: trunk@5223 -
This commit is contained in:
parent
469ac311e0
commit
86a834d2df
@ -186,7 +186,13 @@ const
|
||||
|
||||
function Sign(const AValue: Integer): TValueSign;inline;
|
||||
function Sign(const AValue: Int64): TValueSign;inline;
|
||||
{$ifdef FPC_HAS_TYPE_SINGLE}
|
||||
function Sign(const AValue: Single): TValueSign;inline;
|
||||
{$endif}
|
||||
function Sign(const AValue: Double): TValueSign;inline;
|
||||
{$ifdef FPC_HAS_TYPE_EXTENDED}
|
||||
function Sign(const AValue: Extended): TValueSign;inline;
|
||||
{$endif}
|
||||
|
||||
function IsZero(const A: Single; Epsilon: Single): Boolean;
|
||||
function IsZero(const A: Single): Boolean;inline;
|
||||
@ -541,6 +547,20 @@ begin
|
||||
Result:=ZeroValue;
|
||||
end;
|
||||
|
||||
{$ifdef FPC_HAS_TYPE_SINGLE}
|
||||
function Sign(const AValue: Single): TValueSign;inline;
|
||||
|
||||
begin
|
||||
If Avalue<0.0 then
|
||||
Result:=NegativeValue
|
||||
else If Avalue>0.0 then
|
||||
Result:=PositiveValue
|
||||
else
|
||||
Result:=ZeroValue;
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
|
||||
function Sign(const AValue: Double): TValueSign;inline;
|
||||
|
||||
begin
|
||||
@ -552,6 +572,18 @@ begin
|
||||
Result:=ZeroValue;
|
||||
end;
|
||||
|
||||
{$ifdef FPC_HAS_TYPE_EXTENDED}
|
||||
function Sign(const AValue: Extended): TValueSign;inline;
|
||||
|
||||
begin
|
||||
If Avalue<0.0 then
|
||||
Result:=NegativeValue
|
||||
else If Avalue>0.0 then
|
||||
Result:=PositiveValue
|
||||
else
|
||||
Result:=ZeroValue;
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
function degtorad(deg : float) : float;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user