* Fix isNan, isInfinity, IsPositiveInfinity

git-svn-id: trunk@35356 -
This commit is contained in:
michael 2017-01-29 11:58:22 +00:00
parent 060cb62f2a
commit 8d7fd39282

View File

@ -1,25 +1,25 @@
Class Function TFLOATHELPER.IsNan(const AValue: FLOATTYPE): Boolean; overload; inline; static;
begin
Result:=AValue=Nan;
Result:=TFloatRec(AValue).SpecialType=fsNan;
end;
Class Function TFLOATHELPER.IsInfinity(const AValue: FLOATTYPE): Boolean; overload; inline; static;
begin
Result:=(AValue=PositiveInfinity) or (AValue=NegativeInfinity);
Result:=TFloatRec(AValue).SpecialType in [fsInf,fsNinf];
end;
Class Function TFLOATHELPER.IsNegativeInfinity(const AValue: FLOATTYPE): Boolean; overload; inline; static;
begin
Result:=AValue=NegativeInfinity;
Result:=TFloatRec(AValue).SpecialType=fsNinf;
end;
Class Function TFLOATHELPER.IsPositiveInfinity(const AValue: FLOATTYPE): Boolean; overload; inline; static;
begin
Result:=(AValue=PositiveInfinity);
Result:=TFloatRec(AValue).SpecialType=fsInf;
end;
Class Function TFLOATHELPER.Parse(const AString: string): FLOATTYPE; overload; inline; static;
@ -180,25 +180,25 @@ end;
Function TFLOATHELPER.IsInfinity: Boolean; overload; inline;
begin
Result:=(Self=PositiveInfinity) or (Self=NegativeInfinity);
Result:=TFloatRec(Self).SpecialType in [fsInf,fsNinf];
end;
Function TFLOATHELPER.IsNan: Boolean; overload; inline;
begin
Result:=(Self=Nan);
Result:=TFloatRec(Self).SpecialType=fsNan;
end;
Function TFLOATHELPER.IsNegativeInfinity: Boolean; overload; inline;
begin
Result:=(Self=NegativeInfinity);
Result:=TFloatRec(Self).SpecialType=fsNinf;
end;
Function TFLOATHELPER.IsPositiveInfinity: Boolean; overload; inline;
begin
Result:=(Self=PositiveInfinity);
Result:=TFloatRec(Self).SpecialType=fsInf;
end;
Function TFLOATHELPER.Mantissa: QWord;