Skip to content

Commit

Permalink
Update Expression.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkempire78 committed Nov 19, 2022
1 parent 21db8ed commit 52e91a7
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ class Expression {
val functionsList = listOf("arcos", "arcsin", "arctan", "cos", "sin", "tan", "ln", "log", "exp")
for (function in functionsList) {
val text = cleanCalculation.subSequence(0, i+1).toString()
if (text.endsWith(function)) {
val ze = text[text.length - function.length - 1]
if (text.endsWith(function) && !text.startsWith(function)) {
if (text[text.length - function.length - 1] != '*') {
cleanCalculation = cleanCalculation.subSequence(0, i - function.length + 1).toString() +
"*" + function + cleanCalculation.subSequence(i+1, cleanCalculation.length).toString()
Expand Down

0 comments on commit 52e91a7

Please sign in to comment.