mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-03 01:51:33 +01: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 -
18 lines
278 B
ObjectPascal
18 lines
278 B
ObjectPascal
uses
|
|
sysutils;
|
|
|
|
var
|
|
s: string;
|
|
begin
|
|
str(1.575:0:2,s);
|
|
writeln(s);
|
|
if (s<>'1.58') then
|
|
halt(1);
|
|
str(0.575:0:2,s);
|
|
writeln(s);
|
|
if (s<>'0.58') then
|
|
halt(2);
|
|
// writeln(FloatToStrF(1.575 ,ffFixed,19,2));
|
|
// writeln(FloatToStrF(0.575 ,ffFixed,19,2));
|
|
end.
|