fix: {.calc.} not working with very small numbers (because rendered with exponential syntax)

This commit is contained in:
Massimo Melina 2020-06-16 23:14:45 +02:00
parent 65d4a142e4
commit 26ddc2b126
2 changed files with 4 additions and 5 deletions

View File

@ -1962,10 +1962,7 @@ try
begin
try
if isFalse(parEx('if')) then
begin
result:='';
exit;
end;
exit('');
except end;
result:=md.cd.disconnectReason; // return the previous state
if pars.count > 0 then md.cd.disconnectReason:=p;

View File

@ -2576,7 +2576,8 @@ var
i:=mImp+dir;
repeat
j:=i+dir;
if (j > 0) and (j <= length(s)) and charInSet(s[j], ['0'..'9','.']) then
if (j > 0) and (j <= length(s))
and (charInSet(s[j], ['0'..'9','.','E']) or (j>1) and charInSet(s[j],['+','-']) and (s[j-1]='E')) then
i:=j
else
break;
@ -2606,6 +2607,7 @@ begin
end;
if (i = 1) // a starting operator is not an operator
or (s[i-1]='E') // exponential syntax
or (v <= mImpV) // left-to-right precedence
then continue;
// we got a better one, record it