RPN.exe: Floating-point arithmetic operations in Reverse Polish Notation
Posted: 22 Jan 2021 01:14
When floating point operations are required in a Batch file, the possible solutions are limited to just a few options. PowerShell is a common solution, but it is very slow. JScript is more efficient, but it also have some drawbacks. The other possible standard methods to perform non-integer operations in a Batch file have also multiple problems...
Some time ago I wrote an auxiliary program called printf.exe that allows to perform floating point arithmetic operations; however, it is difficult to use...
I want to present now my new RPN.exe program. This application is comprised of several parts that provides different advantages in the same package. In its simplest form, it allows to perform floating point operations in Reverse Polish Notation in a very simple way. For example, to evaluate the algebraic expression (3+4) / (5+6) and store the result in a variable, just type:
The RPN.zip package have several other features, like an interactive mode that allows to practice RPN expressions in a simple way that includes a simple help feature, up to a very simple, but complete and efficient, programming language. You may download this application from my new APAacini.com site. Note that this download site is new, so the system will show a warning about the "low number of times" that RPN.zip file have been downloaded. Just ignore the warning messages.
If you download and use it, I'll appreciate if you post here any opinion or comment about the RPN.exe package.
Enjoy it!
Antonio
PS - The RPN package is best suited for young people of about 13-15 years old, that is, for any people capable of use (and program) an electronic calculator. If you know such a people and you want to introduce them to the computer programming world, I suggest you to pass to them a copy of RPN.zip package...
Some time ago I wrote an auxiliary program called printf.exe that allows to perform floating point arithmetic operations; however, it is difficult to use...
I want to present now my new RPN.exe program. This application is comprised of several parts that provides different advantages in the same package. In its simplest form, it allows to perform floating point operations in Reverse Polish Notation in a very simple way. For example, to evaluate the algebraic expression (3+4) / (5+6) and store the result in a variable, just type:
Code: Select all
for /F %a in ('rpn 3 4 + 5 6 + /') do set "resul=%a"
If you download and use it, I'll appreciate if you post here any opinion or comment about the RPN.exe package.
Enjoy it!
Antonio
PS - The RPN package is best suited for young people of about 13-15 years old, that is, for any people capable of use (and program) an electronic calculator. If you know such a people and you want to introduce them to the computer programming world, I suggest you to pass to them a copy of RPN.zip package...