4 ms·
Classic HP calculators used a fixed stack of four registers. In practice, you can do quite complicated things before you blow that up. Especially if you underst
by Pinus 2y ago
Classic HP calculators used a fixed stack of four registers. In practice, you can do quite complicated things before you blow that up. Especially if you understand how the mechanism works, and plan ahead a bit.
Besides, infix-style calculators also seem to use a stack to handle operator precedence — if you squint a bit at the manual, you can usually see the shunting-yard algorithm at work behind the curtains.
Actually, some really early HP:s (only desktops, though, like the 9100) used a three-level “stack”, which I put in quotes, because it relied on the user to shift the registers up and down as needed. But they cheated a bit and displayed all three registers, so that the user could see what was where.
- roelschroeven 2y ago> Besides, infix-style calculators also seem to use a stack to handle operator precedence True, but simple calculators, even ones a bit more advanced than the one in the article (e.g. with a sqrt and/or % key) don't handle operator precedence. I'm not sure it's even correct to call them infix calculators, for that reason. They simply work sequentially; no stack needed.