mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-31 09:42:36 +02:00

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 -
33 lines
623 B
ObjectPascal
33 lines
623 B
ObjectPascal
{ Source provided for Free Pascal Bug Report 2643 }
|
|
{ Submitted by "Wayne Sullivan" on 2003-08-19 }
|
|
{ e-mail: Wayne.Sullivan@cnri.dit.ie }
|
|
program pbug;
|
|
var d:double;
|
|
s:string;
|
|
s1:string;
|
|
begin
|
|
d:=5168568.5;
|
|
str(d:10,s);
|
|
if s<>' 5.17E+006' then
|
|
begin
|
|
writeln(s);
|
|
halt(1);
|
|
end;
|
|
str(d:11,s);
|
|
if s<>' 5.169E+006' then
|
|
begin
|
|
writeln(s);
|
|
halt(1);
|
|
end;
|
|
str(d,s);
|
|
if sizeof(extended) > 8 then
|
|
s1 := ' 5.16856850000000E+006'
|
|
else
|
|
s1 := ' 5.16856850000000E+006';
|
|
if s<>s1 then
|
|
begin
|
|
writeln(s);
|
|
halt(1);
|
|
end;
|
|
end.
|