mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
fix: {.calc.} not working with very small numbers (because rendered with exponential syntax)
This commit is contained in:
parent
65d4a142e4
commit
26ddc2b126
@ -1962,10 +1962,7 @@ try
|
|||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
if isFalse(parEx('if')) then
|
if isFalse(parEx('if')) then
|
||||||
begin
|
exit('');
|
||||||
result:='';
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
except end;
|
except end;
|
||||||
result:=md.cd.disconnectReason; // return the previous state
|
result:=md.cd.disconnectReason; // return the previous state
|
||||||
if pars.count > 0 then md.cd.disconnectReason:=p;
|
if pars.count > 0 then md.cd.disconnectReason:=p;
|
||||||
|
|||||||
@ -2576,7 +2576,8 @@ var
|
|||||||
i:=mImp+dir;
|
i:=mImp+dir;
|
||||||
repeat
|
repeat
|
||||||
j:=i+dir;
|
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
|
i:=j
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
@ -2606,6 +2607,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
if (i = 1) // a starting operator is not an operator
|
if (i = 1) // a starting operator is not an operator
|
||||||
|
or (s[i-1]='E') // exponential syntax
|
||||||
or (v <= mImpV) // left-to-right precedence
|
or (v <= mImpV) // left-to-right precedence
|
||||||
then continue;
|
then continue;
|
||||||
// we got a better one, record it
|
// we got a better one, record it
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user