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

Implicit multiplication #42

Open
creativecreatorormaybenot opened this issue Jan 7, 2021 · 3 comments
Open

Implicit multiplication #42

creativecreatorormaybenot opened this issue Jan 7, 2021 · 3 comments
Labels
enhancement Indicates new feature requests

Comments

@creativecreatorormaybenot
Copy link
Contributor

creativecreatorormaybenot commented Jan 7, 2021

First of all, again: I really appreciate your work on this package ✨

Problem

In mathematics, you can usually write 2x to refer to 2 * x. This is also how e.g. calculators, TeX, etc. handle it.

math_expressions does not seem to be able to handle implicit multiplication.

Using 2x in an expression will throw an exception.

@fkleon fkleon added the enhancement Indicates new feature requests label Jan 8, 2021
@fkleon
Copy link
Owner

fkleon commented Jan 8, 2021

Yep, this is not supported in the parser at the moment. Will have a look at this for the parser rewrite.

@creativecreatorormaybenot
Copy link
Contributor Author

@fkleon Super exciting news! 🚀

Let me know if I can be of any help in that regard.

@fkleon
Copy link
Owner

fkleon commented Jul 31, 2024

Support for this has been partially implemented in #87 and #88 by @juca1331. It still requires use of some parentheses (e.g. (2)x) and likely doesn't work for all cases. It's opt-in via parser options. Feel free to have a play with this and leave any feedback here for improvements.

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

No branches or pull requests

2 participants