Git Product home page Git Product logo

simplecalculator's Introduction

SimpleCalculator

A simple calculator that i made in SLU during my freshman year 2019 to 2020 3/11/2020

FAQ:

Algorithm used?

  • Shunting Yard Algorithm by Dijkstra

Why Shunting Yard?

  • Shunting yard is used for getting the Reverse Polish Notation of a given series.

What is RPN (Reverse Polish Notation)?

  • It is a re-arranged series of the user's input which is arranged through proper precedence of operators.

After getting the RPN, What now?

  • The given RPN of the user's inputted series would then be computer.

How is the computing done?

  • A token is taken from the given series ( series is splitted into different tokens by a space ) then the algorithm checks if it is a number. If it is it would then be added to the stack, if it is not it is automatically understood that the token is an operator. There are 2 kinds of operators given. First one is an operator that needs two numbers for computing and the other one only needs one.

TLDR'd the computing process...

  • Process:
    IF (TOKEN IS DIGIT)
    PUT TOKEN IN STACK
    ELSE
    IF TOKEN NEEDS TWO NUMBERS
    COMPUTE NUM1 && NUM 2 WITH GIVEN TOKEN
    ELSE
    COMPUTE NUM WITH GIVEN TOKEN

simplecalculator's People

Contributors

arevalolance avatar

Watchers

 avatar

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.