3 ms·
When I used to teach math, the difference in how calculators handled precedence was always a problem. I would tell students to enter 1+2×3 into their calculator
by dhosek 2y ago
When I used to teach math, the difference in how calculators handled precedence was always a problem. I would tell students to enter 1+2×3 into their calculators and if they got 9,¹ they should throw away the calculator and buy one that worked properly. Not respecting the precedence rules is bad design.
The calculator built into Windows (at least back then, maybe they’ve changed it), gave 9 to my test instead of 7.
⸻
1. If they got some number other than 9 or 7, I recommended dousing it in holy water, and then gasoline, burning it, encasing the ashes in concrete and dropping that concrete block into the deepest part of the ocean because that calculator is cursed.
- kweingar 2y agoNot respecting precedence is ok, as long as the user is aware of it. When I use a calculator, I don't necessarily care if I can punch in a written expression verbatim from left to right. I just want to do a calculation.
- dhosek 2y agoExcept that if you’re a high school student who is using a calculator for stuff most if not all of the readers on this site would do in your head, having a calculator that ignores precedence just makes things that much harder.
- BlueTemplar 2y agoA high school student should already know the difference between a dumb calculator that can only show a single number and a smart calculator that lets you to write a full line while using () before pressing =, having used both already by middle school.
- evalstate 2y agojust tested this. in "standard" mode you get 7, switch to "scientific" you get 9.
- gf000 2y agoThese "four-function" calculators only display the last number. It would be widely unexpected if doing x3 when all I see is a 2 would sometimes give 6 or some other value (e.g. the student next to me just passed a calculator with a value displayed, so I don't know if it had any previous instructions and no way to find out) The UX is pretty clear - it's ANS operator newNumber. That's it, if not somehow displayed, then it shouldn't have a more complicated model inside either. It can freely do "normal" math the moment they write out the whole expression tree, as the result of an expression is the one calculated by precedence rules. The result of a two-operand operation is not that, though.