mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 10:45:08 +02:00
* patch by Bart B: FormatFloat correctly outputs NaN now, resolves #32868
+ test
This commit is contained in:
parent
bb51ac77dd
commit
989895c82f
@ -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
14
tests/webtbs/tw32868.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user