mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-07 11:20:32 +01:00
significant digits and frac(value)+roundcorr overflows to 1
(mantis #15308, fix by Dariusz Mazur)
git-svn-id: trunk@14563 -
26 lines
473 B
ObjectPascal
26 lines
473 B
ObjectPascal
program testformatfloat;
|
|
|
|
uses SysUtils;
|
|
|
|
const
|
|
val_format: string = '0.0000E+000';
|
|
|
|
var
|
|
input: extended;
|
|
|
|
begin
|
|
decimalseparator:='.';
|
|
input:=1.05e2;
|
|
if (formatfloat(val_format,input)<>'1.0500E+002') then
|
|
begin
|
|
writeln(formatfloat(val_format,input));
|
|
halt(1);
|
|
end;
|
|
input:=1.06e2;
|
|
if (formatfloat(val_format,input)<>'1.0600E+002') then
|
|
begin
|
|
writeln(formatfloat(val_format,input));
|
|
halt(2);
|
|
end;
|
|
end.
|