mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 03:09:15 +02:00
* Fix isNan, isInfinity, IsPositiveInfinity
git-svn-id: trunk@35356 -
This commit is contained in:
parent
060cb62f2a
commit
8d7fd39282
@ -1,25 +1,25 @@
|
|||||||
Class Function TFLOATHELPER.IsNan(const AValue: FLOATTYPE): Boolean; overload; inline; static;
|
Class Function TFLOATHELPER.IsNan(const AValue: FLOATTYPE): Boolean; overload; inline; static;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=AValue=Nan;
|
Result:=TFloatRec(AValue).SpecialType=fsNan;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Class Function TFLOATHELPER.IsInfinity(const AValue: FLOATTYPE): Boolean; overload; inline; static;
|
Class Function TFLOATHELPER.IsInfinity(const AValue: FLOATTYPE): Boolean; overload; inline; static;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=(AValue=PositiveInfinity) or (AValue=NegativeInfinity);
|
Result:=TFloatRec(AValue).SpecialType in [fsInf,fsNinf];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Class Function TFLOATHELPER.IsNegativeInfinity(const AValue: FLOATTYPE): Boolean; overload; inline; static;
|
Class Function TFLOATHELPER.IsNegativeInfinity(const AValue: FLOATTYPE): Boolean; overload; inline; static;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=AValue=NegativeInfinity;
|
Result:=TFloatRec(AValue).SpecialType=fsNinf;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Class Function TFLOATHELPER.IsPositiveInfinity(const AValue: FLOATTYPE): Boolean; overload; inline; static;
|
Class Function TFLOATHELPER.IsPositiveInfinity(const AValue: FLOATTYPE): Boolean; overload; inline; static;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=(AValue=PositiveInfinity);
|
Result:=TFloatRec(AValue).SpecialType=fsInf;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Class Function TFLOATHELPER.Parse(const AString: string): FLOATTYPE; overload; inline; static;
|
Class Function TFLOATHELPER.Parse(const AString: string): FLOATTYPE; overload; inline; static;
|
||||||
@ -180,25 +180,25 @@ end;
|
|||||||
Function TFLOATHELPER.IsInfinity: Boolean; overload; inline;
|
Function TFLOATHELPER.IsInfinity: Boolean; overload; inline;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=(Self=PositiveInfinity) or (Self=NegativeInfinity);
|
Result:=TFloatRec(Self).SpecialType in [fsInf,fsNinf];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TFLOATHELPER.IsNan: Boolean; overload; inline;
|
Function TFLOATHELPER.IsNan: Boolean; overload; inline;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=(Self=Nan);
|
Result:=TFloatRec(Self).SpecialType=fsNan;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TFLOATHELPER.IsNegativeInfinity: Boolean; overload; inline;
|
Function TFLOATHELPER.IsNegativeInfinity: Boolean; overload; inline;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=(Self=NegativeInfinity);
|
Result:=TFloatRec(Self).SpecialType=fsNinf;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TFLOATHELPER.IsPositiveInfinity: Boolean; overload; inline;
|
Function TFLOATHELPER.IsPositiveInfinity: Boolean; overload; inline;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=(Self=PositiveInfinity);
|
Result:=TFloatRec(Self).SpecialType=fsInf;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TFLOATHELPER.Mantissa: QWord;
|
Function TFLOATHELPER.Mantissa: QWord;
|
||||||
|
Loading…
Reference in New Issue
Block a user