* patch by Bart B: FormatFloat correctly outputs NaN now, resolves #32868

+ test
This commit is contained in:
florian 2022-10-11 22:10:37 +02:00
parent bb51ac77dd
commit 989895c82f
2 changed files with 19 additions and 0 deletions

View File

@ -317,6 +317,11 @@ var
begin
Result:=0;
Initvars;
if E.IsNan then
begin
AddToResult('NaN');
Exit;
end;
// What section to use ?
if (E>0) then
S:=1

14
tests/webtbs/tw32868.pp Normal file
View File

@ -0,0 +1,14 @@
program project1;
{$mode objfpc}{$H+}
uses
Math,SysUtils;
begin
if FormatFloat('0.#',Nan)<>'NaN' then
begin
WriteLn(FormatFloat('0.#',Nan));
halt(1);
end;
end.