Skip to content

Commit

Permalink
fix #349 #340
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkempire78 committed Nov 5, 2023
1 parent 679fa41 commit ca427f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class Calculator(
nextChar()
val x = parseExpression()
if (pos < equation.length) println("Unexpected: \"" + ch.toChar() + "\" in expression: " + equation)
syntax_error = true
return x
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class Expression {
cleanCalculationLength ++
}
} else if (cleanCalculation[i] == ')') {
if (i+1 < cleanCalculation.length && (cleanCalculation[i+1] in "0123456789(")) {
if (i+1 < cleanCalculation.length && (cleanCalculation[i+1] in "0123456789(.")) {
cleanCalculation = cleanCalculation.addCharAtIndex('*', i+1)
cleanCalculationLength ++
}
Expand Down

0 comments on commit ca427f4

Please sign in to comment.