mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 19:29:26 +02:00
* fixed for extended = double
This commit is contained in:
parent
e90bd0332a
commit
f9152c2c6b
@ -10,19 +10,32 @@ const Inf=1/0;
|
||||
var
|
||||
s : string;
|
||||
error : boolean;
|
||||
s1, s2, s3 : string;
|
||||
begin
|
||||
if sizeof(extended) > 8 then
|
||||
begin
|
||||
s1 := ' +Inf';
|
||||
s2 := ' Nan';
|
||||
s3 := ' -Inf';
|
||||
end
|
||||
else
|
||||
begin
|
||||
s1 := ' +Inf';
|
||||
s2 := ' Nan';
|
||||
s3 := ' -Inf';
|
||||
end;
|
||||
error:=false;
|
||||
str(Inf,s);
|
||||
writeln('Inf: "',s,'"');
|
||||
if s<>' +Inf' then
|
||||
if s<>s1 then
|
||||
error:=true;
|
||||
str(NaN,s);
|
||||
writeln('Nan: "',s,'"');
|
||||
if s<>' Nan' then
|
||||
if s<>s2 then
|
||||
error:=true;
|
||||
str(MinusInf,s);
|
||||
writeln('MinusInf: "',s,'"');
|
||||
if s<>' -Inf' then
|
||||
if s<>s3 then
|
||||
error:=true;
|
||||
if error then
|
||||
begin
|
||||
|
@ -4,6 +4,7 @@
|
||||
program pbug;
|
||||
var d:double;
|
||||
s:string;
|
||||
s1:string;
|
||||
begin
|
||||
d:=5168568.5;
|
||||
str(d:10,s);
|
||||
@ -19,7 +20,11 @@ begin
|
||||
halt(1);
|
||||
end;
|
||||
str(d,s);
|
||||
if s<>' 5.168568500000000E+006' then
|
||||
if sizeof(extended) > 8 then
|
||||
s1 := ' 5.168568500000000E+006'
|
||||
else
|
||||
s1 := ' 5.16856850000000E+006';
|
||||
if s<>s1 then
|
||||
begin
|
||||
writeln(s);
|
||||
halt(1);
|
||||
|
Loading…
Reference in New Issue
Block a user