Information Technology - Computer Programming - Source Code - Homebrew - Open Source - Software - Hardware - 8 bit - 16 bit - 32 bit - 64 bit - x86 - x64 - DOS - Windows - Linux - Arduino - Embedded - Development - Retro - Vintage - Math - Science - History - Hobby - Beginners - Professionals - Experiment - Research - Study - Fun - Games

RPN Calc

Anything GW-BASIC, QBasic, Quick Basic, Free Basic, QB64, or RapidQ related.
Post Reply
admin
Site Admin
Posts: 106
Joined: Wed Feb 22, 2023 6:51 am

RPN Calc

Post by admin »

Written in Quick Basic.

FREEWARE Open Source

RPN Calc is command line expression evaluator.
Written in Quick BASIC and compatible with x86 DOS.

Example expressions:

Code: Select all

(18/3)^2+((13+7)*5^2)
2*20/2+(3+4)*3^2-6+15
(3*5^2/15)-(5-2^2)
(5.9-5.3)*7.2+1.4^2
(2.1^2+5.2-7.2)*7.1
(18/3)^2+((13+7)*5^2)
(-B+SQR(B^2-4*A*C))/(2*A)
(-B-SQR(B^2-4*A*C))/(2*A)
Type help for assistance.

Operator precedence:

NOT(), ^, MOD, *, /, +, -, <, >, <=, >=, =, <>, XOR, AND, OR

Functions:

ABS() INT() SQR() SIN() COS() TAN() ATN() LOG() SGN() EXP() RND PI

Bitwise operations are not supported.

# inserts the last evaluation in an expression.
Enter STOA - STOZ to store the last evaluation.
Enter RESET to set values for the variables.
Enter LIST to view the variables values.

Enter CLS to erase the screen.
Enter STEPS to disable/enable printing and recording of steps.
Enter EXIT to end the program.
Enter HELP or ? to see this text again.

http://www.lucidapogee.com/download.php ... pncalc.zip
admin
Site Admin
Posts: 106
Joined: Wed Feb 22, 2023 6:51 am

Re: RPN Calc

Post by admin »

Update!

I was about ready to send this project to the graveyard as I have been working on newer things. With the newer Express Calculator and RP1 projects being written in C and PHP, I thought it would be good to update RPN Calc so there's an example of my expression evaluator in Quick BASIC/QBasic. RPN Calc has been neglected, so it wasn't good enough to remain. This update will hopefully change that as well as pave the way for even more updates.

This update includes:

fixed handling of negation
added EXP() function
commands are now parsed as functions to simplify the code
commands are modified to be closer to the newer Express Calculator.
hex values may now be denoted with the &H prefix

This update was a bit rushed and still needs more testing. I have little time between my job and off time to work on code. I will probably be making modifications if any problems arise. I have given RPN Calc the Alpha version designation to mark future updates. If you find an issue, as always please let me know so I can fix it.
Post Reply