Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for implicit multiplication #64

Closed
zimmerrol opened this issue Apr 6, 2016 · 2 comments
Closed

Support for implicit multiplication #64

zimmerrol opened this issue Apr 6, 2016 · 2 comments

Comments

@zimmerrol
Copy link

Hello,
are there any plans to support implicit multiplications, so that 5SIN(2) will be interpreted as 5*SIN(2)? (Or is this even already possible and I am just unable to find this functionality?)

Edit: I tried to solve this issue by modifing the shuntingYard method by adding addition if-statements like this

if (isNumber(token)) {
      if (previousToken != null && ")".equals(previousToken))
      {
           stack.push("×");
      }
     ...
} else if (functions.containsKey(token.toUpperCase(Locale.ROOT))) {
     if (previousToken != null && isNumber(previousToken))
     {
            stack.push("×");
     }
 ....

This seems to work after a few test, but I am not completely sure about it. Are there any opinions?

@uklimaschewski
Copy link
Collaborator

I am not very happy with this kind of syntax, it has the potential to open a whole new can of worms.
E.g. What about A5BSIN(2) - is this a function named A5BSIN or an expression A*5*SIN(2) ?

@zimmerrol
Copy link
Author

Hm, that's a true problem. But are there any plans to support these multiplications? Because they are somehow very often used by users...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants