Small RPN exponential routine
|
01-02-2015, 10:25 PM
Post: #1
|
|||
|
|||
Small RPN exponential routine
This would make more sense on the HP-16C, which lacks exponentiation, but the equivalent program is 23 steps long.
I wrote a 42S version as an optimization exercise and managed to save five steps and two registers (but only two bytes), when compared to the first version. Perhaps more optimization is still possible, but I'll stop here. I'll publish the HP-16C version, in case someone is interested (on the 16C this should be a first step towards a usable exponential function implementation). Code:
Examples: 1 ENTER 14 XEQ EX --> 2.71828182846 3.14159265359 ENTER 22 --> 23.1406926328 1000 ENTER 1400 --> 1.97007111402e434 ( Free 42 only! ) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)