fpc/tests/webtbs/tw2226.pp
Jonas Maebe ecf4aa7f55 * use rounding correction in str_real based on smallest possible
delta for which 1.0 and 1.0+delta is different, rather than
    some power-of-10 ballpark equivalent (fixes mantis #11308)
  * print the same number of digits for doubles on systems
    which support extended as on those which don't (i.e.,
    one digit less on the former). This solves regressions after
    the previous change and is Delphi-compatible.
  * adapted tests for the previous change

git-svn-id: trunk@11025 -
2008-05-21 16:55:31 +00:00

23 lines
428 B
ObjectPascal

{ Source provided for Free Pascal Bug Report 2226 }
{ Submitted by "" on 2002-11-12 }
{ e-mail: }
Program compcrash;
const mindouble: double = -5.0E324;
var
s : string;
correct : string;
begin
case sizeof(extended) of
10: correct := ' -Inf';
8: correct := ' -Inf';
end;
str(mindouble,s);
if s<>correct then
begin
writeln('error');
halt(1);
end;
end.