mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-01 21:22:38 +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 -
28 lines
555 B
ObjectPascal
28 lines
555 B
ObjectPascal
uses
|
|
math;
|
|
var
|
|
s : string;
|
|
Begin
|
|
{$ifdef FPC_HAS_TYPE_EXTENDED}
|
|
str(intpower(2,63),s);
|
|
if s<>' 9.2233720368547758E+0018' then
|
|
begin
|
|
WriteLn(intpower(2,63));
|
|
halt(1);
|
|
end;
|
|
{$endif FPC_HAS_TYPE_EXTENDED}
|
|
|
|
{$ifdef FPC_HAS_TYPE_DOUBLE}
|
|
str(double(intpower(2,63)),s);
|
|
{$ifdef FPC_HAS_TYPE_EXTENDED}
|
|
if s<>' 9.22337203685478E+018' then
|
|
{$else FPC_HAS_TYPE_EXTENDED}
|
|
if s<>' 9.22337203685478E+018' then
|
|
{$endif FPC_HAS_TYPE_EXTENDED}
|
|
begin
|
|
WriteLn(double(intpower(2,63)));
|
|
halt(1);
|
|
end;
|
|
{$endif FPC_HAS_TYPE_DOUBLE}
|
|
end.
|