A full featured rpn calculator
Project description
RPN Calculator by Akbar BadShah
It's a full-fledged rpn calculator I made to practice my pythonic skills. Works fine to the best of my knowledge, but you're still welcome to share your thoughts, add features, report and correct bugs.
New Features!
+
: 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 stackcla
: Clear both stack and variableclr
: Empty the stackclv
: Clear both stack and variable!
: None!=
: Return True if last two numbers in stack are equal, False otherwise%
: Take 2 integers from the stack, divide them and put the remainder in the stack++
: Increment an integer--
: Decrement an integer&
: Take 2 numbers from the stack, apply a bitwise "and" and put the result in the stack|
: Take 2 numbers from the stack, apply a bitwise "or" and put the result in the stack^
: 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 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 stack&&
: Perform boollean AND operation on two values and output the result (not added to the stack)||
: Perform boollean OR operation on two values and output the result (not added to the stack)^^
: Perform boolean XOR operation on two values and output the result (not added to the stack)<
: Smaller than operation on two values and output the result (not added to the stack)<=
: Smaller than or equal to operation on two values and output the result (not added to the stack)==
: Equal to operation on two values and output the result (not added to the stack)>
: Greater than operation on two values and output the result (not added to the stack)>=
: Greater than operation on two values and output the result (not added to the stack)acos
: Take arc cosine on a value and output the result (also added to the stack)asin
: Take arc sine on a value and output the result (also added to the stack)atan
: Take arc tangent on a value and output the result (also added to the stack)cos
: Take cosine on a value and output the result (also added to the stack)cosh
: Take arc hyperbolic cosine on a value and output the result (also added to the stack)sin
: Take sine on a value and output the result (also added to the stack)sinh
: Take hyperbolic sine on a value and output the result (also added to the stack)tanh
: Take hyperbolic tangent on a value and output the result (also added to the stack)ceil
: Take ceil of an integer and output the result (also added to the stack)floor
: Take floor of an integer and output the result (also added to the stack)round
: Take round of an integer and output the result (also added to the stack)ip
: Separates int from floating part of a decimal number and output the result (also added to the stack)fp
: separates floating part of a decimal number and output the result (also added to the stack)abs
: Take ceil of an integer and output the result (also added to the stack)max
: Take maximum value of the stack and output the result (also removed from the stack)min
: Take minimum value of the stack and output the result (also removed from the stack)hex
: Change display mode to hexbin
: Change display mode to binarydec
: Change display mode to decimale
: Nonepi
: Nonerand
: Noneexp
: Apply e**x to the last number of the stackfact
: Push factorial of the last number to the stacksqrt
: Push factorial of the last number to the stackln
: Apply log10 to the last number of the stacklog
: Apply log10 to the last number of the stackpow
: Take 2 numbers from the stack, apply power and put the result in the stackpick
: Pick the nth item form stackrepeat
: Repeat an operation n timesdrop
: Drop the top most item from the stackdropn
: Drop the n top most items from the stackdup
: Duplicates the top item from the stackdupn
: Duplicates n top items of thew stackroll
: Roll the stack upwards by nrolld
: Roll the stack downwards by nstack
: Toggles stack display from horizontal to verticalswap
: Swap the top 2 stack itemsx=
: Assigns a variable, e.g. '1024 x='help
: Print help; Same as pol --listexit
: Quit the program
Available Modes
- For one time result of a single line statement, do:
rpn 3 2 + #(should exit outputting 5)
- To solve statements from a file before entering shell, do:
rpn --file #path
- To simply enter the shell, do:
rpn
Installation
pip install advanced_rpn_calculator
Todos
- Write MORE Tests or just test if everything works fine.
License
MIT
Free Software, Hell Yeah!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for advanced_rpn_calculator-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d7424f702c301d5dacad461511bbdc0c4da196d665f2ee0c4909cd6e67aebd7 |
|
MD5 | 1905f38be3a6a632505db5665429b3f6 |
|
BLAKE2b-256 | 2a6eead1a8332352c5ab63a2162733c023d6100f0099712d46c23b9f257dd75b |