GithubHelp home page GithubHelp logo

martinheywang / literal-calculator-web Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 214 KB

A literal math expression reducer made with web technologies (TypeScript + Sass)

Home Page: https://martinheywang.github.io/literal-calculator-web

HTML 3.92% SCSS 6.63% TypeScript 89.44%

literal-calculator-web's People

Contributors

martinheywang avatar

Stargazers

 avatar

Watchers

 avatar

literal-calculator-web's Issues

Error when reducing: '(h-1)^3'

Error when reducing: '(h-1)^3'

Input: '(h-1)^3'
Message: "can't access property "symbol", operators[term.data.name] is undefined"

Looks weird...

Simplify complex fractions

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.

Reduction fails when expression equals zero

All literal expressions that equal zero fails at reducing.

The console shows a recursion error.

Current behaviour :

  • 3 - 3 = (error)
  • 2x - 2x = (error)
  • 2x * 0 = (error)

Expected behaviour :

  • 3 - 3 = 0
  • 2x - 2x = 0
  • 2x * 0 = 0

Distribution does not work with powers

Examples of the current behaviour :

  • 2x (3x + 5) = 6x^2 + 10x
  • 2x (3x^2 + 5) = 66x^3 + 10x
  • 2x (3a^2 + 5) = 66a^3 + 10x

Expected :

  • 2x (3x^2 + 5) = 6x^3 + 10x
  • 2x (3a^2 + 5) = 6a^3 + 10x

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.