Commit fa25d70e authored by Victor Yacovlev's avatar Victor Yacovlev

Partial fixed floating point I/O + (maybe) part of last commit

parent 3a99d2bb
......@@ -4613,7 +4613,7 @@ AST::Expression * SyntaxAnalizerPrivate::makeExpressionTree(const QList<Subexpre
(tailIsLiteral && literalOperands)
);
if (headExpr->expressionIsClosed)
if (headExpr && headExpr->expressionIsClosed)
makeCNF = false;
if (makeCNF) {
......
......@@ -779,7 +779,7 @@ public:
return 0.0;
}
fraction = fromDecimal(sFractional);
fraction = fromDecimal(sFractional.substr(0,fractionalLength));
for (int i=0; i<fractionalLength; i++) {
fraction /= 10.0;
}
......@@ -866,6 +866,16 @@ public:
if (rightSpaces>0)
result.append(rightSpaces, ' ');
}
if (!expform) {
int chopPos;
for (chopPos=result.length()-1; chopPos>0; chopPos--) {
if (result[chopPos]!='0')
break;
}
if (result[chopPos]=='.')
chopPos += 1;
result = result.substr(0, chopPos+1);
}
String uniresult = Coder::decode(ASCII, result);
size_t dotPos = uniresult.find_first_of('.');
if (dotPos!=String::npos) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment