martinheywang / literal-calculator-web Goto Github PK
View Code? Open in Web Editor NEWA literal math expression reducer made with web technologies (TypeScript + Sass)
Home Page: https://martinheywang.github.io/literal-calculator-web
A literal math expression reducer made with web technologies (TypeScript + Sass)
Home Page: https://martinheywang.github.io/literal-calculator-web
Examples of the current behaviour :
Expected :
Unexpected result when reducing: '2|3 + 5|3'
https://martinheywang.github.io/literal-calculator-web/?expression=2%7C3%20%2B%205%7C3
Input: '2|3 + 5|3'
Current output: 2 | 3 + 5 | 3
Expected output: 7 | 3
The program should be able to sum up fractions together, it looks like it is not doing anything here.
Error when reducing: '(h-1)^3'
Input: '(h-1)^3'
Message: "can't access property "symbol", operators[term.data.name] is undefined"
Looks weird...
Error when reducing: 'h + (-1)'
https://martinheywang.github.io/literal-calculator-web/?expression=h%20*%20(-1)
Input: 'h + (-1)'
Message: "can't access property "data", expression.right.operator is undefined"
*Error when reducing: '((2+1)3)^2'
Input: '((2+1)*3)^2'
Message: "Can't stringify term of an unknown type."
All literal expressions that equal zero fails at reducing.
The console shows a recursion error.
Current behaviour :
Expected behaviour :
Unexpected result when reducing: (x+y)(x+y)/(x+y)
https://martinheywang.github.io/literal-calculator-web/?expression=(x%2By)(x%2By)%2F(x%2By)
Input: (x+y)(x+y)/(x+y)
Current output: (x^2 + y^2 + 2xy)|(x + y)
Expected output: (x+y)
The result is not wrong in itself. The program develops (x+y)(x+y)
and then fails at dividing by (x+y)
.
Unexpected result when reducing: '536x - 45x^2'
https://martinheywang.github.io/literal-calculator-web/?expression=536x%20-%2045x%5E2
Input: '536x - 45x^2'
Current output: 491x^2
Expected output: -45x^2 + 536x
The algorithm should not sum up x and x squared together.
Unexpected result when reducing: '2*(x+1)^2/6'
Input: '2*(x+1)^2/6'
Current output: (2x^2 + 4x + 2) | 6
Expected output: (x^2 + 2x + 1) | 3
The algorithm should be able to simplify fractions with an expression at the numerator or the denominator.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.