zathras / jrpn

JRPN - A Calculator Simulator Inspired by the HP-16C "Computer Scientist" Calculator and the HP-15C Scientific Calculator
https://jrpn.jovial.com/
Other
65 stars 8 forks source link

setting a matrix dimension to 0x0 #80

Closed whuyse closed 8 months ago

whuyse commented 8 months ago

JRPN15C

Describe the bug Setting a matrix' dimensions to 0 does not work when X or Y contains a matrix desciptor

To Reproduce RCL MATRIX A 0 DIM A returns : Error 9

Expected behavior DIM A-E or DIM I must set the dimensions of the matrix to 0x0 if X and/or Y contains a 0, whatever the contents of the other may be, even if it is a matrix descriptor. That is the behavior of a standard 15C

Platform: JRPN 15C Version 2.1.10 web running on Windows 10 Enterprise under Chrome 122.0.6261.95

Additional context Add any other context about the problem here.

zathras commented 8 months ago

Interesting! I would have never guess the 15C had that behavior. I don't think it's in the manual, but I verified on my 15C, and sure enough, it makes a special case for zeroing out a matrix. I'd call that a worthwhile enhancement that improves the fidelity of the simulation.

whuyse commented 8 months ago

Not explicitly, no. On pg 143, the manual says: 'You can dimension a single matrix to 0 × 0 by pressing 0 f DIM {A through E}.' It doesn't say anything about the contents of Y - so already it should work regardless of what is in Y. But it also works with a 0 in Y and anything in X. and also with f DIM I, if register I contains a matrix descriptor.

zathras commented 8 months ago

Published in 2.1.12