Skip to content

Commit 170496b

Browse files
authored
Merge pull request #12 from bxparks/develop
merge 0.7.0 into master
2 parents 1090b19 + 3edd127 commit 170496b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+6932
-2181
lines changed

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,79 @@
11
# Changelog
22

33
- Unreleased
4+
- 0.7.0 (2023-11-20)
5+
- `STAT`
6+
- fix broken `Sigma+` and `Sigma-` when `Y==0`
7+
- use alternate equation for `SLOP` (slope) which works when the `Y`
8+
data points are the same
9+
- fix "stack lift disable" feature of `Sigma+` and `Sigma-` which
10+
probably got broken during an earlier refactoring
11+
- check for division by zero when calculating weighted mean `WMN`, and
12+
show `9.9999999999999E99` to indicate error, allowing weightedX (or
13+
weightedY) to be evaluated even if the other is undefined
14+
- `BASE`
15+
- implement `WSIZ` (set word size) restricted to 8, 16, 24, and 32
16+
(inspired by HP-16C and Free42)
17+
- display appropriate number of digits for various `WSIZ` values, for
18+
various base modes (`HEX`, `OCT`, `BIN`)
19+
- display ellipsis character on left most digit in `BIN` mode if
20+
the binary number cannot be fully displayed using 14 digits on the
21+
screen
22+
- **Breaking Change**: change order of `BDIV` results in `X` and `Y`
23+
registers
24+
- now `X=quotient=Y/X` and `Y=remainder=Y%X`
25+
- allows easier recovery of original `X` using `LastX` `*`
26+
- `MATH`: add `LN1+`, `E^X-`
27+
- implement `log(1+x)` and `e^x-1` respectively
28+
- more accurate than their naive implementations when `x` is close to 0
29+
- use mathematical identities involving hyperbolic `sinh()` and
30+
`asinh()` functions to avoid roundoff errors
31+
- `TVM`
32+
- add TVM (time value of money) submenu hierarchy (inspired by HP-12C
33+
and HP-30b)
34+
- implement relatively simple Newton-Secant root solver to calculate
35+
the `I%YR` from the other 4 TVM variables
36+
- significant performance and robustness improvements can probably be
37+
made in the future
38+
- add storage register arithmetic operations
39+
- `STO+`, `STO-`, `STO*`, `STO/`
40+
- `RCL+`, `RCL-`, `RCL*`, `RCL/`
41+
- convert to multi-page flash application
42+
- now consumes 2 flash pages (2 x 16 kiB)
43+
- `CLEAR` multiple times to clear RPN stack
44+
- If `CLEAR` is pressed on an empty edit line (just a `_` cursor), then
45+
the message "CLEAR Again to Clear Stack" will be displayed.
46+
- If `CLEAR` is pressed again right after this message, the RPN stack is
47+
cleared, invoking the `ROOT > CLR > CLST` menu function.
48+
- Provides a quick shortcut to the `CLST` function which can be
49+
difficult to reach when the current menu item is deeply nested in
50+
another part of the menu hierarchy.
51+
- The TI-OS does not support `2ND CLEAR`, it returns the same keycode as
52+
`CLEAR`. So invoking `CLST` on multiple `CLEAR` presses seemed like
53+
the most reasonable workaround.
54+
- implement jumpBack for `MODE` button shortcut
55+
- When `ROOT > MODE` is reached through the hierchical menu, the
56+
`ON/EXIT/ESC` button goes back up the menu hierarchy to the parent,
57+
the `ROOT`.
58+
- When `ROOT > MODE` is invoked through the `MODE` button on the
59+
keyboard, the `ON/EXIT/ESC` button jumps back to the previous menu
60+
location, instead of going back up the menu tree.
61+
- This allows quick changes to the `FIX`, `SCI`, and `ENG` display
62+
modes, without losing one's place in the menu hierarchy.
63+
- fix incorrect handling of `DEL` after a `FIX`, `SCI`, or `ENG` mode
64+
- when the `DEL` (backspace) button is pressed after a 2-digit argument
65+
of a `FIX` (or `SCI` etc), one of the digits of the 2-digit argument
66+
remained in the input buffer
67+
- the fix now correctly clears the input buffer when transitioning into
68+
edit mode from a normal mode
69+
- **Potential Breaking Change**: `STO`, `RCL`, `FIX`, `SCI`, `ENG` argument
70+
prompt is no longer saved and restored on QUIT or OFF
71+
- a new Command Arg parser was required to support storage register
72+
arithmetics
73+
- it uses a secondary `GetKey()` parsing loop which implements its own
74+
`2ND QUIT` and `2ND OFF` handlers
75+
- the state of the secondary `GetKey()` parsing loop is not saved and
76+
restored
477
- 0.6.0 (2023-09-22)
578
- save application state
679
- preserve app state into an appvar named `RPN83SAV` upon exit

DEVELOPER.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Developer Notes
2+
3+
Notes for the developers of the RPN83P app, likely myself in 6 months when I
4+
cannot remember how the code works.
5+
6+
## DRAW Mode
7+
8+
The secret `DRAW` (maybe call it "Debug") modes are activated by the `2ND DRAW`
9+
command. It prompts the user for a number, like the `FIX` or `STO` command.
10+
Currently 4 modes defined:
11+
12+
- 0 (drawNodeNormal): Normal rendering, this is the default.
13+
- 1 (drawModeTvmSolverI): Single step through the `I%YR` TVM Solver
14+
calculations, and show the iteration counter (`tvmSolverCount`), and the
15+
internal interest rate variables (`tvmI0`, `tvmI1`) in place of the RPN stack
16+
variables (T,Z,Y,X). The program waits for a key before executing the next
17+
iteration.
18+
- 2 (drawModeTvmSolverF): Same as (1), except show the values of the function
19+
whose roots we are trying to solve at `tvmI0` and `tvmI1`, in other words,
20+
show the variables `tvmNPMT0` and `tvmNPMT1`.
21+
- 3 (drawModeInputBuf): Show the `inputBuf` (the edit buffer when entering
22+
digits) in the Debug line just below the Status line. The `X` register is now
23+
always shown, instead of being overwritten by the `inputBuf` in Edit mode.
24+
This helps debugging the complex interaction between the input buffer and the
25+
X register.

README.md

Lines changed: 73 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ calculator app for the [TI-83 Plus](https://en.wikipedia.org/wiki/TI-83_series)
77
(including the Silver Edition) and the [TI-84
88
Plus](https://en.wikipedia.org/wiki/TI-84_Plus_series) (including the Silver
99
Edition). The app is inspired mostly by the
10-
[HP-42S](https://en.wikipedia.org/wiki/HP-42S) calculator, with some sprinkles
11-
of older HP calculators like the
12-
[HP-12C](https://en.wikipedia.org/wiki/HP-12C), the
13-
[HP-15C](https://en.wikipedia.org/wiki/HP-15C), and the
10+
[HP-42S](https://en.wikipedia.org/wiki/HP-42S) calculator, with some significant
11+
features from the
12+
[HP-12C](https://en.wikipedia.org/wiki/HP-12C) and the
1413
[HP-16C](https://en.wikipedia.org/wiki/HP-16C).
1514

1615

17-
The RPN83P is a flash application that consumes one page (16 kB) of flash
16+
The RPN83P is a flash application that consumes 2 pages (32 kiB) of flash
1817
memory. Since it is stored in flash, it is preserved if the RAM is cleared. It
19-
consumes about 375 bytes of TI-OS RAM: 2 list variables named `REGS` and `STK`,
18+
consumes about 400 bytes of TI-OS RAM: 2 list variables named `REGS` and `STK`,
2019
and an appVar named `RPN83SAV`.
2120

2221
Here is a quick summary of its features:
@@ -25,7 +24,7 @@ Here is a quick summary of its features:
2524
- support for `lastX` register
2625
- 8-line display showing all stack registers
2726
- 25 storage registers (`STO 00`, `RCL 00`, ..., `STO 24`, `RCL 24`)
28-
- hierarchical menu system, inspired by the HP-42S
27+
- hierarchical menu system similar to HP-42S
2928
- support for all math functions with dedicated buttons on the TI-83 Plus and
3029
TI-84 Plus
3130
- arithmetic: `/`, `*`, `-`, `+`
@@ -35,7 +34,7 @@ Here is a quick summary of its features:
3534
- `LOG`, `10^X`, `LN`, `e^X`
3635
- constants: `pi` and `e`
3736
- additional menu functions:
38-
- `X^3`, `CBRT`, `XRootY`, `ATN2`, `2^X`, `LOG2`, `LOGB`
37+
- `X^3`, `3RootX`, `XRootY`, `ATN2`, `2^X`, `LOG2`, `LOGB`
3938
- `%`, `%CH`, `GCD`, `LCM`, `PRIM` (is prime)
4039
- `IP` (integer part), `FP` (fractional part), `FLR` (floor), `CEIL`
4140
(ceiling), `NEAR` (nearest integer)
@@ -44,6 +43,16 @@ Here is a quick summary of its features:
4443
- hyperbolic: `SINH`, `COSH`, `TANH`, `ASNH`, `ACSH`, `ATNH`
4544
- angle conversions: `>DEG`, `>RAD`, `>HR`, `>HMS`, `>REC`, `>POL`
4645
- unit conversions: `>C`, `>F`, `>km`, `>mi`, etc
46+
- features inspired by HP-42S
47+
- `E^X-` (e^x-1), `LN1+` (log(1+x))
48+
- statistics: `Sigma+`, `Sigma-`, `SUM`, `MEAN`, `WMN` (weighted mean),
49+
`SDEV` (sample standard deviation), `SCOV` (sample covariance),
50+
`PDEV` (population standard deviation), `PCOV` (population covariance)
51+
- curve fitting: `Y>X`, `X>Y`, `SLOP` (slope), `YINT` (y intercept), `CORR`
52+
(correlation coefficent)
53+
- curve fit models: `LINF` (linear), `LOGF` (logarithmic), `EXPF`
54+
(exponential), `PWRF` (power)
55+
- features inspired by HP-16C and HP-42S
4756
- base conversions: `DEC`, `HEX`, `OCT`, `BIN`
4857
- bitwise operations: `AND`, `OR`, `XOR`, `NOT`, `NEG`, `REVB` (reverse
4958
bits), `CNTB` (count bits)
@@ -52,13 +61,9 @@ Here is a quick summary of its features:
5261
- shift and rotate: `SL`, `SR`, `ASR`, `RL`, `RR`, `RLC`, `RRC`,
5362
`SLn`, `SRn`, `RLn`, `RRn`, `RLCn`, `RRCn`
5463
- carry flag and bit masks: `CCF`, `SCF`, `CF?`, `CB`, `SB`, `B?`
55-
- statistics: `Sigma+`, `Sigma-`, `SUM`, `MEAN`, `WMN` (weighted mean),
56-
`SDEV` (sample standard deviation), `SCOV` (sample covariance),
57-
`PDEV` (population standard deviation), `PCOV` (population covariance)
58-
- curve fitting: `Y>X`, `X>Y`, `SLOP` (slope), `YINT` (y intercept), `CORR`
59-
(correlation coefficent)
60-
- curve fit models: `LINF` (linear), `LOGF` (logarithmic), `EXPF`
61-
(exponential), `PWRF` (power)
64+
- features inspired by HP-12C and HP-30b
65+
- time value of money (TVM): `N`, `I%YR`, `PV`, `PMT`, `FV`, `P/YR`, `BEG`,
66+
`END`, `CLTV` (clear TVM)
6267
- various display modes
6368
- `RAD`, `DEG`
6469
- `FIX` (fixed point 0-9 digits)
@@ -71,7 +76,7 @@ Here are some missing features which may be added in the future:
7176
- complex numbers
7277
- keystroke programming
7378

74-
**Version**: 0.6.0 (2023-09-22)
79+
**Version**: 0.7.0 (2023-11-20)
7580

7681
**Changelog**: [CHANGELOG.md](CHANGELOG.md)
7782

@@ -86,6 +91,7 @@ Here are some missing features which may be added in the future:
8691
- [Quick Examples](#quick-examples)
8792
- [Example 1](#example-1)
8893
- [Example 2](#example-2)
94+
- [Example 3](#example-3)
8995
- [User Guide](#user-guide)
9096
- [Compiling from Source](#compiling-from-source)
9197
- [Tools and Resources](#tools-and-resources)
@@ -115,7 +121,7 @@ Guide](USER_GUIDE.md), but here is the quick version:
115121

116122
The RPN83P app starts directly into the calculator mode, like this:
117123

118-
> ![RPN83P Hello 1](docs/rpn83p-screenshot-initial.png)
124+
![RPN83P Hello 1](docs/rpn83p-screenshot-initial.png)
119125

120126
Since the RPN83P is a flash app, it is preserved when the RAM is cleared. It
121127
consumes about 300 bytes of RAM space for its internal RPN and storage
@@ -162,18 +168,22 @@ outwards. Enter the following keystrokes:
162168

163169
Here is an animated GIF that shows this calculation:
164170

165-
> ![RPN83P Example 1 GIF](docs/rpn83p-example1.gif)
171+
![RPN83P Example 1 GIF](docs/rpn83p-example1.gif)
166172

167173
(Note that the RPN83P provides a `X^3` menu function that could have been used
168174
for this formula, but I used the `LastX` feature to demonstrate its use.)
169175

170176
### Example 2
171177

178+
The RPN83P supports most of the base conversion and logical operators found on
179+
the HP-42S and the HP-16C calculators.
180+
172181
Let's calculate the bitwise-and operator between the hexadecimal numbers `B6`
173182
and `65`, then see the result as an octal number (base-8), a binary number
174183
(base-2), then right shift the result 3 bits which sets the Carry Flag, then
175184
view the final result as a decimal number:
176185

186+
- Press `MATH` to reset the menu to the home row.
177187
- Navigate the menu with the DOWN arrow to get to
178188
![ROOT MenuRow 2](docs/rpn83p-screenshot-menu-root-2.png)
179189
- Press `BASE` menu to get to
@@ -205,14 +215,57 @@ view the final result as a decimal number:
205215

206216
Here is the animated GIF that shows this calculation:
207217

208-
> ![RPN83P Example 2 GIF](docs/rpn83p-example2.gif)
218+
![RPN83P Example 2 GIF](docs/rpn83p-example2.gif)
219+
220+
### Example 3
221+
222+
The RPN83P supports the Time Value of Money functionality of the HP-12C
223+
calculator.
224+
225+
In this example:
226+
- We calculate the monthly payment of a $500,000 mortgage over 30 years at 8%,
227+
then,
228+
- We recalculate the payment at 7%, then,
229+
- We fix the monthly payment at $3000/month and calculate the interest rate
230+
that is needed for that monthly payment.
231+
232+
Here are the steps:
233+
234+
- Press `MATH` to reset the menu to the home row.
235+
- Navigate the menu with the DOWN arrow to get to
236+
![ROOT MenuRow 2](docs/rpn83p-screenshot-menu-root-2.png)
237+
- Press the `TVM` menu to get to
238+
![TVM MenuRow 1](docs/rpn83p-screenshot-menu-root-tvm-1.png)
239+
- Press the DOWN arrow to get to
240+
![TVM MenuRow 2](docs/rpn83p-screenshot-menu-root-tvm-2.png)
241+
- Press the `CLTV` button to clear the TVM variables.
242+
- Press the UP arrow to get back to
243+
![TVM MenuRow 1](docs/rpn83p-screenshot-menu-root-tvm-1.png)
244+
- Press `360` `N` (30 years * 12 months = 360 payments)
245+
- Press `8` `I%YR` (interest percent per year)
246+
- Press `500000` `PV` (present value)
247+
- Press `0` `FV` (future value)
248+
- Press `PMT` (payments)
249+
- You should see `-3668.822869` ($3668.82)
250+
- Press `7` `I%YR`
251+
- Press `PMT`
252+
- You should see `-3326.512476` ($3326.51)
253+
- Press `-3000` `PMT`
254+
- Press `I%YR`
255+
- After a couple of seconds, you should see 6.006990008 (6%).
256+
257+
Here is the animated GIF that shows this calculation:
258+
259+
![RPN83P Example 3 GIF](docs/rpn83p-example3.gif)
260+
261+
### Exiting the Menu
209262

210263
Press:
211264

212265
- `ON` button (`ESC/EXIT`) multiple times to back to the home menu, or
213266
- `MATH` button (`HOME`) to go back directly.
214267

215-
> ![ROOT MenuRow 1](docs/rpn83p-screenshot-menu-root-1.png)
268+
![ROOT MenuRow 1](docs/rpn83p-screenshot-menu-root-1.png)
216269

217270
## User Guide
218271

0 commit comments

Comments
 (0)