|
@@ -10,6 +10,7 @@ var
|
|
s: tlocalstring;
|
|
s: tlocalstring;
|
|
len: byte;
|
|
len: byte;
|
|
frac: word;
|
|
frac: word;
|
|
|
|
+ longval : longint;
|
|
|
|
|
|
procedure check(const ss: tlocalstring);
|
|
procedure check(const ss: tlocalstring);
|
|
begin
|
|
begin
|
|
@@ -52,18 +53,37 @@ begin
|
|
|
|
|
|
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp }
|
|
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp }
|
|
f := -1.12345;
|
|
f := -1.12345;
|
|
|
|
+{$ifndef FPU_EMULATION}
|
|
str(f,s);
|
|
str(f,s);
|
|
check('-1.123450000000000E+000');
|
|
check('-1.123450000000000E+000');
|
|
- str(f:0,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:1,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:2,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:3,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:4,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
|
|
+{$endif}
|
|
|
|
+ { the number of exponents depends on the maaping of the real type }
|
|
|
|
+ if sizeof(real) = 8 then
|
|
|
|
+ begin
|
|
|
|
+ str(f:0,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:1,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:2,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:3,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:4,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ begin
|
|
|
|
+ str(f:0,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:1,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:2,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:3,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:4,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ end;
|
|
str(f:0:0,s);
|
|
str(f:0:0,s);
|
|
check('-1');
|
|
check('-1');
|
|
str(f:0:1,s);
|
|
str(f:0:1,s);
|
|
@@ -96,6 +116,29 @@ begin
|
|
check('-1');
|
|
check('-1');
|
|
str(i:3,s);
|
|
str(i:3,s);
|
|
check(' -1');
|
|
check(' -1');
|
|
|
|
+ i:=655536;
|
|
|
|
+ str(i,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:0,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:1,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:2,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:3,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ longval:=1;
|
|
|
|
+ i:=int64(longval) shl 33;
|
|
|
|
+ str(i,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:0,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:1,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:2,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:3,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
|
|
q := 10;
|
|
q := 10;
|
|
str(q,s);
|
|
str(q,s);
|
|
@@ -108,6 +151,29 @@ begin
|
|
check('10');
|
|
check('10');
|
|
str(q:3,s);
|
|
str(q:3,s);
|
|
check(' 10');
|
|
check(' 10');
|
|
|
|
+ q:=655536;
|
|
|
|
+ str(q,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:0,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:1,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:2,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:3,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ longval:=1;
|
|
|
|
+ q:=qword(longval) shl 33;
|
|
|
|
+ str(q,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:0,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:1,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:2,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:3,s);
|
|
|
|
+ check('8589934592');
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure test_ansistr;
|
|
procedure test_ansistr;
|
|
@@ -122,6 +188,7 @@ var
|
|
s: tlocalstring;
|
|
s: tlocalstring;
|
|
len: shortint;
|
|
len: shortint;
|
|
frac: smallint;
|
|
frac: smallint;
|
|
|
|
+ longval : longint;
|
|
|
|
|
|
procedure check(const ss: tlocalstring);
|
|
procedure check(const ss: tlocalstring);
|
|
begin
|
|
begin
|
|
@@ -164,18 +231,37 @@ begin
|
|
|
|
|
|
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp }
|
|
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp }
|
|
f := -1.12345;
|
|
f := -1.12345;
|
|
|
|
+{$ifndef FPU_EMULATION}
|
|
str(f,s);
|
|
str(f,s);
|
|
check('-1.123450000000000E+000');
|
|
check('-1.123450000000000E+000');
|
|
- str(f:0,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:1,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:2,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:3,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:4,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
|
|
+{$endif}
|
|
|
|
+ { the number of exponents depends on the maaping of the real type }
|
|
|
|
+ if sizeof(real) = 8 then
|
|
|
|
+ begin
|
|
|
|
+ str(f:0,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:1,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:2,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:3,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:4,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ begin
|
|
|
|
+ str(f:0,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:1,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:2,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:3,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:4,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ end;
|
|
str(f:0:0,s);
|
|
str(f:0:0,s);
|
|
check('-1');
|
|
check('-1');
|
|
str(f:0:1,s);
|
|
str(f:0:1,s);
|
|
@@ -208,6 +294,29 @@ begin
|
|
check('-1');
|
|
check('-1');
|
|
str(i:3,s);
|
|
str(i:3,s);
|
|
check(' -1');
|
|
check(' -1');
|
|
|
|
+ i:=655536;
|
|
|
|
+ str(i,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:0,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:1,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:2,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:3,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ longval:=1;
|
|
|
|
+ i:=int64(longval) shl 33;
|
|
|
|
+ str(i,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:0,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:1,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:2,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:3,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
|
|
q := 10;
|
|
q := 10;
|
|
str(q,s);
|
|
str(q,s);
|
|
@@ -220,6 +329,29 @@ begin
|
|
check('10');
|
|
check('10');
|
|
str(q:3,s);
|
|
str(q:3,s);
|
|
check(' 10');
|
|
check(' 10');
|
|
|
|
+ q:=655536;
|
|
|
|
+ str(q,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:0,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:1,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:2,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:3,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ longval:=1;
|
|
|
|
+ q:=qword(longval) shl 33;
|
|
|
|
+ str(q,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:0,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:1,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:2,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:3,s);
|
|
|
|
+ check('8589934592');
|
|
end;
|
|
end;
|
|
|
|
|
|
{$ifdef haswidestring}
|
|
{$ifdef haswidestring}
|
|
@@ -235,6 +367,7 @@ var
|
|
s: tlocalstring;
|
|
s: tlocalstring;
|
|
len: longint;
|
|
len: longint;
|
|
frac: cardinal;
|
|
frac: cardinal;
|
|
|
|
+ longval : longint;
|
|
|
|
|
|
procedure check(const ss: tlocalstring);
|
|
procedure check(const ss: tlocalstring);
|
|
begin
|
|
begin
|
|
@@ -277,18 +410,37 @@ begin
|
|
|
|
|
|
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp }
|
|
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp }
|
|
f := -1.12345;
|
|
f := -1.12345;
|
|
|
|
+{$ifndef FPU_EMULATION}
|
|
str(f,s);
|
|
str(f,s);
|
|
check('-1.123450000000000E+000');
|
|
check('-1.123450000000000E+000');
|
|
- str(f:0,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:1,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:2,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:3,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
- str(f:4,s);
|
|
|
|
- check('-1.1E+000');
|
|
|
|
|
|
+{$endif}
|
|
|
|
+ { the number of exponents depends on the maaping of the real type }
|
|
|
|
+ if sizeof(real) = 8 then
|
|
|
|
+ begin
|
|
|
|
+ str(f:0,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:1,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:2,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:3,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ str(f:4,s);
|
|
|
|
+ check('-1.1E+000');
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ begin
|
|
|
|
+ str(f:0,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:1,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:2,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:3,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ str(f:4,s);
|
|
|
|
+ check('-1.1E+00');
|
|
|
|
+ end;
|
|
str(f:0:0,s);
|
|
str(f:0:0,s);
|
|
check('-1');
|
|
check('-1');
|
|
str(f:0:1,s);
|
|
str(f:0:1,s);
|
|
@@ -321,6 +473,29 @@ begin
|
|
check('-1');
|
|
check('-1');
|
|
str(i:3,s);
|
|
str(i:3,s);
|
|
check(' -1');
|
|
check(' -1');
|
|
|
|
+ i:=655536;
|
|
|
|
+ str(i,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:0,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:1,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:2,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(i:3,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ longval:=1;
|
|
|
|
+ i:=int64(longval) shl 33;
|
|
|
|
+ str(i,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:0,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:1,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:2,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(i:3,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
|
|
q := 10;
|
|
q := 10;
|
|
str(q,s);
|
|
str(q,s);
|
|
@@ -333,6 +508,29 @@ begin
|
|
check('10');
|
|
check('10');
|
|
str(q:3,s);
|
|
str(q:3,s);
|
|
check(' 10');
|
|
check(' 10');
|
|
|
|
+ q:=655536;
|
|
|
|
+ str(q,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:0,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:1,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:2,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ str(q:3,s);
|
|
|
|
+ check('655536');
|
|
|
|
+ longval:=1;
|
|
|
|
+ q:=qword(longval) shl 33;
|
|
|
|
+ str(q,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:0,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:1,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:2,s);
|
|
|
|
+ check('8589934592');
|
|
|
|
+ str(q:3,s);
|
|
|
|
+ check('8589934592');
|
|
end;
|
|
end;
|
|
{$endif haswidestring}
|
|
{$endif haswidestring}
|
|
|
|
|