GithubHelp home page GithubHelp logo

mounirbenzi / rpn-2.0 Goto Github PK

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

Handles big ints and rational numbers

Makefile 0.33% C 74.54% C++ 3.16% Python 21.96%
c rpn rpn-calculator bigint rational-numbers

rpn-2.0's Introduction

Description: This is a Reverse Polish Notation Calculator, which is capable of basic arithmetic: addition, subtraction, multiplication and division.
	      The calculator also handles big integers, and now also rational numbers.
              Users should enter operands and operators, making sure no illegal operators have been entered. Allowed operators are (+ , -, x, /)
              The correct number of operators should be used according to how many operands have been entered. It should be noted that there is a maximum of 10 operands.

Usage: This program can be executed from the command line, using the line:  $ ./rpn.exe operands... operators

            For example, basic addition would be carried out as such:
            $ ./rpn.exe 1 1 1 + +
            3
            To demonstrate subtraction:
            $ ./rpn.exe 8 6 1 - -
            3
            This can be slightly confusing, but this operation works as 8 - (6-1)
            The multiplication operator is x
            $ ./rpn.exe 5 6 1 x x
            30
            Program can handle rational numbers, and simplifies
            $ ./rpn.exe 14 3 /
            7/3
            $ ./rpn.exe 7 0 /
            Zero division in 7 / 0
	    Program can handle values outside the range of int
	    $./rpn.exe 10000000000000000000 100000000000000000 /
	    100

            It is also possible to see the version of the program, using:
            $ ./rpn.exe --version
            The usage of the program can also be shown by running
            $ ./rpn.exe --usage

Implementation: All of the functions for the operators, the stack and error checking functions have been implemented and are working. 
		Along with the rational numbers and bigint data types.

rpn-2.0's People

Contributors

mounirbenzi 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.