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