mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-07 12:20:47 +01:00
based on the Grisu1 algorithm. This corrects several precision issues
with the previous code used to perform such conversions (patch by
Max Nazhalov, mantis #25241)
o adaptation of several tests to deal with the better precision of these
routines compared to the previous version
Please don't remove the real2str.inc file yet, it's still used by the
JVM target for now
git-svn-id: trunk@25888 -
33 lines
626 B
ObjectPascal
33 lines
626 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:22,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.
|