5 ms·
I realised reading this that, even though I used to be quite adept with these common four-function calculators, I have since forgotten most of their operation.
by kqr 2y ago
I realised reading this that, even though I used to be quite adept with these common four-function calculators, I have since forgotten most of their operation. The past ten years or so I have exclusively been using RPN calculators – I find them so much easier to work with, and going by this article, possibly even easier to implement sensibly?
(My main drivers are Emacs Calc on the computer and RealCalc on Android devices. For kitchen work I use a slide rule, which is something I think more people should do! There is nothing better for translating proportions.)
- persnickety 2y agoRPN is definitely easier to implement. I helped someone do that as a student project and while it was minimally complex, there were no edge cases with the operators. You pay for that by having a stack rather than a small fixed number of variables.
- tgv 2y agoClassical 4-func calcs are easier, I think. They don't even need a stack, just a place to store the previous value and the current input.
- _moof 2y agoMy HP RPN calculator only has four positions available in its stack, which I imagine makes the implementation a bit simpler than a stack of arbitrary size.
- persnickety 2y agoThe typical 4-function calculator doesn't even allow multiple subtrees of computation, so I think it works out to having something like 2 entries on the stack.
- enriquto 2y ago> You pay for that by having a stack rather than a small fixed number of variables. you can easily add variables to your rpn calculator. For example ">x" pops the top of the stack into the variable x, and "<x" pushes the value of x to the stack. You can also interpret parentheses as whitespace to enable users to group parts of the computation (but this may become confusing when they write nonsensical parentheses).
- ropejumper 2y agoThey meant that the implementation of a four-function calculator only needs a few fixed variables rather than a stack.
- PeterStuer 2y agoIn my youth my treasure was a HP41cv. I always found RPN far more logical, conceptually cleaner and as a result far simpler to use.
- koblas 2y agoPlus, for owners of the HP41, if you had an essay question in your chemistry test you could type in cliff notes... Naw, I never did that.
- PeterStuer 2y agoI did do that! But data entry was so laborious that by the time you entered the formulas you basically knew them by hard.
- nottorp 2y agoA decent way to cram for an exam you don't care much about is to hand copy the course material too. You'll most likely end up retaining enough to pass.
- 7thaccount 2y agoIf you want a recreation: https://www.swissmicros.com/product/dm41x https://www.swissmicros.com/product/dm41x They also have their own versions of the 15c and so on. I have 3 different models (and one original HP RPN calc) and can confirm they are really high quality. Again though, spreadsheets are a lot more useful to me when I have more than just a simple calculation or two. I think these are mostly getting picked up by hobbyists, collectors, and those who work in labs and need a dedicated device with physical buttons. Note that it doesn't have the big expansion pack things that I think the 41c came with if I'm thinking about the right calculator.
- ghaff 2y agoI've been really tempted as my 41CV doesn't work any longer but I do real calculating so little that it would just be a nostalgia trip. (And I have a couple of the horizontal format HP calcs that still work for any of the calculator stuff I do sometimes do outside of an app.)
- layer8 2y agoYes, RPN is easier to implement, and for the same reason also easier to reason about as a user,
- 7thaccount 2y agoI own several RPN calculators (they are very cool), but still find modern TI or Casio calculators to be superior now when I'm not using a spreadsheet or something like Mathematica. Even 15 years ago, you could type out an entire equation that would have to be used multiple times and just update a single part of it and hit enter and then scroll up, modify, and hit enter again. All of that without having to resort to keystroke programming. RPN is easier to reason about, but in aggregate doesn't save much time when you have a really slick modern interface and can scroll around and see things pretty printed. In engineering it is common to have some crazy looking things that are just easier to reason about when you can see it matches what is on the paper in front of you.
- bruce343434 2y ago> things [] are just easier to reason about when you can see it matches what is on the paper in front of you. I have this sentiment every time I dive into some "other" programming math notation. Such as (lisp), rpn, infix without precedence, etc. In theory I like it, but then in practice it's just kind of painful. We humans are entrenched in our bad but default notation!
- roelschroeven 2y agoIs infix notation even that bad? I guess RPN has advantages for use as an input method for calculators, but as an actual algebraic notation? It seems to me it's very cumbersome to perform standard algebra on equations in RPN notation (or prefix notation, for that matter). I can't be sure but as far as I know nobody has using anything other than infix for algebra. Every time I see a text explaining the advantages of RPN, it's always in the context of calculator input.
- 7thaccount 2y agoThere are disadvantages to RPN as well. I read a book on the Forth programming language (also uses RPN) and some calculations that are algebraically simple require pretty bizarre stack shuffling with RPN stacks. I wish I had the source example. It was something pretty standard in a highschool algebra book like the midpoint formula or something like that. The reverse might be true as well in some situations, but I can't recall any examples outside of RPN's historical advantage against old TI calcs in the 80s. Maybe a forth or RPN enthusiast could help.
- Kim_Bruning 2y agoDo you also use dc? (can be used on terminal / termux) https://linux.die.net/man/1/dc https://linux.die.net/man/1/dc
- kqr 2y agoYes, but mainly in scripts and oneliners (never learned the Bash arithmetic substitution thing). For interactive use I often have a shorter time-to-arrival to either Emacs or RealCalc.
- taeric 2y agoI'm super intrigued on the slide rule idea! Where did you get one and what sort of stuff do you typically do with it?
- alexjm 2y agoI have a kitchen slide that I use for ratios in recipes. It's an old plastic one from Think Geek. For example, I usually put 15 grams of coffee with 8 oz of water (please excuse the mixed units). To make a different amount, I align the 1.5 on the top rule with the 8 on the bottom rule to set the ratio. Then each number on the top rule (coffee in grams) matches the scaled value on the bottom rule (water in oz). The 6 on the bottom rule aligns with ~1.1 on the top, meaning I should brew my little six-ounce cup with 11g of coffee. In practice, I do this a lot with bread, but the "baker's percent" convention for writing bread recipes makes it a more complicated example. Another way to use a kitchen slide rule is when scaling a recipe. Say I want to make 2/3 of a batch of cookies. I line up the 3 on top with the 2 on the bottom. Then for each ingredient, I find the recipe's quantity on top, and read off the scaled quantity on the bottom. This works better with recipes that use weights, to avoid awkward fractions or converting between units so you can subdivide.
- kibwen 2y agoAgreed, my spicy take is operator precedence was a mistake that we regrettably inherited from mathematical notation. Parentheses for grouping are fine, at least.