mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-22 16:39:34 +01:00
* fix for extended constants
This commit is contained in:
parent
d2aa336b2f
commit
062604c406
@ -479,23 +479,23 @@ begin
|
|||||||
begin
|
begin
|
||||||
{ Read integer part }
|
{ Read integer part }
|
||||||
flags:=flags or 1;
|
flags:=flags or 1;
|
||||||
valfloat:=valfloat*10;
|
valfloat:=valfloat*10+(ord(s[code])-ord('0'));
|
||||||
valfloat:=valfloat+(ord(s[code])-ord('0'));
|
|
||||||
inc(code);
|
inc(code);
|
||||||
end;
|
end;
|
||||||
{ Decimal ? }
|
{ Decimal ? }
|
||||||
if (s[code]='.') and (length(s)>=code) then
|
if (s[code]='.') and (length(s)>=code) then
|
||||||
begin
|
begin
|
||||||
hd:=0.1;
|
hd:=1.0;
|
||||||
inc(code);
|
inc(code);
|
||||||
while (s[code] in ['0'..'9']) and (length(s)>=code) do
|
while (s[code] in ['0'..'9']) and (length(s)>=code) do
|
||||||
begin
|
begin
|
||||||
{ Read fractional part. }
|
{ Read fractional part. }
|
||||||
flags:=flags or 2;
|
flags:=flags or 2;
|
||||||
valfloat:=valfloat+hd*(ord(s[code])-ord('0'));
|
valfloat:=valfloat*10+(ord(s[code])-ord('0'));
|
||||||
hd:=hd/10.0;
|
hd:=hd*10.0;
|
||||||
inc(code);
|
inc(code);
|
||||||
end;
|
end;
|
||||||
|
valfloat:=valfloat/hd;
|
||||||
end;
|
end;
|
||||||
{ Again, read integer and fractional part}
|
{ Again, read integer and fractional part}
|
||||||
if flags=0 then
|
if flags=0 then
|
||||||
@ -528,12 +528,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{ Calculate Exponent }
|
{ Calculate Exponent }
|
||||||
|
{
|
||||||
if esign>0 then
|
if esign>0 then
|
||||||
for i:=1 to exponent do
|
for i:=1 to exponent do
|
||||||
valfloat:=valfloat*10
|
valfloat:=valfloat*10
|
||||||
else
|
else
|
||||||
for i:=1 to exponent do
|
for i:=1 to exponent do
|
||||||
valfloat:=valfloat/10;
|
valfloat:=valfloat/10; }
|
||||||
|
hd:=1.0;
|
||||||
|
for i:=1 to exponent do
|
||||||
|
hd:=hd*10.0;
|
||||||
|
if esign>0 then
|
||||||
|
valfloat:=valfloat*hd
|
||||||
|
else
|
||||||
|
valfloat:=valfloat/hd;
|
||||||
{ Not all characters are read ? }
|
{ Not all characters are read ? }
|
||||||
if length(s)>=code then
|
if length(s)>=code then
|
||||||
begin
|
begin
|
||||||
@ -563,7 +571,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.34 2000-02-09 16:59:31 peter
|
Revision 1.35 2000-04-06 11:51:47 pierre
|
||||||
|
* fix for extended constants
|
||||||
|
|
||||||
|
Revision 1.34 2000/02/09 16:59:31 peter
|
||||||
* truncated log
|
* truncated log
|
||||||
|
|
||||||
Revision 1.33 2000/01/07 16:41:36 daniel
|
Revision 1.33 2000/01/07 16:41:36 daniel
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user