GithubHelp home page GithubHelp logo

rpn's Introduction

REVERSE POLISH NOTATION CALCULATOR

RPN - the Reverse Polish Notation CLI calculator.

Installation

pipenv shell
pipenv install .

Usage

rpn --help                - view help screen
rpn                       - launch in interactive mode
rpn [expression]          - evaluate a one line expression

NOTE:
rpn will execute the contents of ~/.rpnrc at startup if it exists.

One line expression examples:
-----------------------------
$ rpn 1 2 +
$ rpn 1 2 + dup * 3 repeat dup * * swap drop sqrt pi * 20 / round 1024 1024 * *

Interactive mode example:
-----------------------------
$ rpn
> 1 2 +
[3]> dup
[3 3]> *
[9]> 3 repeat dup * *
[9 729]> swap drop
[729]> sqrt
[27.0]> pi *
[84.82300164692441]> 20 /
[4.241150082346221]> round
[4]> macro kb 1024 *
[4]> macro mb 1024 1024 * *
[4]> dbg
kb=1024 *, mb=1024 1024 * * [4]> dbg
[4]> mb
[4194304]> x=
> dbg
kb=1024 *, mb=1024 1024 * *, x=4194304 > x x +
kb=1024 *, mb=1024 1024 * *, x=4194304 [8388608]> stack
Variables:
================
kb=1024 *
mb=1024 1024 * *
x=4194304
Stack:
================
8388608
--------
> 1 mb /
Variables:
================
kb=1024 *
mb=1024 1024 * *
x=4194304
Stack (upside down):
================
8.0
--------
> clr
Variables:
================
kb=1024 *
mb=1024 1024 * *
x=4194304
> clv
>
> exit
$

Author

James La Guma

rpn's People

Watchers

James La Guma 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.