accept implicit multiplication as input
See original GitHub issueHi Davide,
Look at the lines below:
var a=require('algebrite');
var expr="(2x-5)*(3x-3)*(x+4)";
var exprS = a.simplify(expr).toString();
console.log(exprS); // display 3 (2 x^3 + x^2 - 23 x + 20)
console.log(a.expand(exprS).toString()); // display nil
exprS = exprS.charAt(0) + "*" + exprS.slice(1); // put a "*" between 3 and the rest
console.log(a.expand(exprS).toString()); // display 6 x^3 + 3 x^2 - 69 x + 60
Simplify produces a expression with implicit multiplication (“*”) but expand does not accept it. I believe that the best approach would be expand come around to accepting implicit multiplication.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Order of Operations: Implicit Multiplication? - The Math Doctors
Implied multiplication has a higher priority than explicit multiplication to allow users to enter expressions, in the same manner as they ...
Read more >"implied multiplication" operator precedence?
Updated: Implied multiplication is everywhere, 1x = x and x/1=x. Any number times 1 is that number and any number divided by 1...
Read more >Allow implicit multiplication of multiple single-character variables ...
Enhancing the MathJS expression syntax to allow multiple single-character variables to be implicitly multiplied would make it more closely resemble mathematics ...
Read more >ANTLR Implicit Multiplication - grammar - Stack Overflow
Specifically, I've tried adding some simple functions, negative numbers and so on, to familiarize myself with ANTLR. However, I've run into a bit...
Read more >Ambiguous PEMDAS - Harvard Mathematics Department
Under this more sophisticated convention, the implicit multiplication in 2(2 + 2) is given higher priority than the explicit division in 8÷2(2 +...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
can now parse the example above - can parse whenever one of the factors is a “naked” number. See tests at the commit linked in the “closure” message above.
Great, @davidedc, thanks!