Package: rpn-calc
polCommand line calculator usingreverse polish notationDecimal, hexadecimal, binary and octal number are supportedUsageAs a command line tool:pol~$ pol
Reverse polish notation calculator
>5 10 * dec
50
>0xA 0x6 + hex
0x10
>q //quit the program
~$Instructions arebelowpol can also be use as a moduleimportrpn_calccal=rpn_calculator.Calculator()cal.evaluate("1 2 + dec")# print 3Installpol can be install from pippip install rpn-calcIf you want to install from a source distribution, extract the tarball and run the following commandpython setup.py installDocumentationThis README is the DocumentationRepoThe code is on githubConfig fileYou can write your own commandBy default commands from file ~/pol.yml (if exists) are add to the calculatorYou can add other files with the flag -f/--fileConfig files are written in YAMLCurrently supported parametersshortcut: shortcut to commands (see example below)rounding: parameter used to round number (default: 0)Example of a valid config fileshortcut:-double = 2 *# double the last value of the stack-10* = 10 switch **# same as 10 {x} **rounding:3Command must be on the format {name_of_command = command}Optionsusage: pol [-h] [-v] [-l] [--ignore-local-config] [-f FILE [FILE ...]]

A RPN calculator written in python
Support decimal, hexadecimal, binary and octal

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show the version number and exit
  -l, --list            list all commands available and exit
  --ignore-local-config
                        don't add commands from ~/.pol
  -f FILE [FILE ...], --file FILE [FILE ...]
                        file with customs commandsList of commands+: Take 2 numbers from the stack, add them and put the result in the stack-: Take 2 numbers from the stack, substracte them and put the result in the stack*: Take 2 numbers from the stack, mul them and put the result in the stack/: Take 2 numbers from the stack, divise them and put the result in the stack//: Take 2 numbers from the stack, divise them and put the integer result in the stack%: Take 2 numbers from the stack, divise them and put the remainder in the stack**: Take 2 numbers from the stack, apply power and put the result in the stacksqrt: Replace the last number in the stack with the square root of itselfexp: Apply e**x to the last number of the stacklog10: Apply log10 to the last number of the stacklog2: Apply log2 to the last number of the stackln: Apply natural logarithm to the last number of the stackand: Take 2 numbers from the stack, apply a bitwise "and" and put the result in the stackor: Take 2 numbers from the stack, apply a bitwise "or" and put the result in the stackxor: Take 2 numbers from the stack, apply a bitwise "xor" and put the result in the stack<<: Take 2 numbers from the stack, apply a left shift and put the result in the stack>>: Take 2 numbers from the stack, apply a right shift and put the result in the stackabs: Make absolute the last value of the stackinv: Inverse the last number of the stackneg: Change the sign of the last number in the stacksin: Replace the last number in the stack with the sine of itself (measured in radians)cos: Replace the last number in the stack with the cosine of itself (measured in radians)tan: Replace the last number in the stack with the tangent of itself (measured in radians)asin: Replace the last number in the stack with the arc sine of itself (measured in radians)acos: Replace the last number in the stack with the arc cosine of itself (measured in radians)atan: Replace the last number in the stack with the arc tangent of itself (measured in radians)atan2: Take 2 numbers from the stack, apply a atan2 function and put the result in the stacksinh: Replace the last number in the stack with the hyperbolic sine of itselfcosh: Replace the last number in the stack with the hyperbolic cosine of itselftanh: Replace the last number in the stack with the hyperbolic tangent of itselfasinh: Replace the last number in the stack with the asinh of itselfacosh: Replace the last number in the stack with the acosh of itselfatanh: Replace the last number in the stack with the atanh of itselftorad: Convert the last number from degree to radiantodeg: Convert the last number from radian to degreeswitch: Switch the last 2 numbers of the stackdel: Delete the last number in the stackcopy: Copy the last number of the stack and add it to the stackpi: Add pi to the stacktau: Add tau to the stacke: Add e to the stacksum: Take all the number of the stack and add the sumfact: Replace the last number in the stack with its factorialround: Round the last number in the stackave: Take all the number of the stack and add the averagedec: Print the last number of the stack and remove ithex: Print in hexadecimal format the last number of the stack and remove itbin: Print in binary format the last number of the stack and remove itoct: Print in octal format the last number of the stack and remove itratio: Print in integer ratio format the last number of the stack and remove its: Print the stackclear: Empty the stackback: Put back on the stack the last value that was printedhelp: Print help; Same as pol --listq: Quit the programLicenseMIT