4 ms·
OK, I get the first two. Strictly speaking, mult and div have the same precedence (6 / 2 * 3 should be the same as 6 * 3 / 2 , both 9), but in one case, the cal
by trjordan 15y ago
OK, I get the first two. Strictly speaking, mult and div have the same precedence (6 / 2 * 3 should be the same as 6 * 3 / 2 , both 9), but in one case, the calculator interpreted the multiplication in 2(1+2) as having higher precedence than 2*(1+2). Arguably a bug, but nothing crazy.
But ... the iPhone gives 2? I don't get it.
(FWIW, Android says 9)
- laacz 15y agoMy iPhone gives 9. I entered "6/2*(1+2)".
- thekungfuman 15y agoYou have to test it without the explicit "*" and see if it performs the order of operations correctly.
- laacz 15y agoMy iPhone gives 9. I entered "6/2*(1+2)".
- mrgoldenbrown 15y agoI don't like calling one interpretation of an ambiguous notation a bug but not the other. Either they are both possible bugs or neither are. The ambiguity comes in when we try to apply rules we learned for encoding (handwritten notation) to another encoding scheme (the calculator). Handwritten math uses positional information to encode order of operations. Calculator math can either try to mimic this (like one Casio did) or ignore this and revert to strict "all multiply and divide operations have equal precedence" (which the other Casio did) Fractions and exponents are other areas where handwritten notation and calculator notation don't overlap very well.
- ricardobeat 15y agoThe iPhone ignores any input before opening a group if you don't give it an operator. 5(2) = 2 999(2+2) = 4
- nsns 15y agoSo it should have given 3.
- Someone 15y ago'before…within the term or factor": 2*2455(6) = 12 2+47435)7 = 14 (according to the iPhone calculator in scientific mode)
- ColinDabritz 15y agoI'm guessing you meant: 7+47435)7 = 14 for the second example? I get 9 as written on my iPhone. The correction above gives 14. The interesting thing to me is that the close parenthesis cause the same behavior. The consistent logic appears to be "an operator entered in error causes input to reset" or something like that. Also errors are silently ignored in the easiest way possible, perhaps internally the value never gets pushed to the stack or something along those lines. I wonder what other 'errors' could show this behavior?
- Xlythe 15y agoNo, if you drop the number before the parenthesis you get 6/3, or 2. 6 ÷ 2 ( 1 + 2 ) 6 ÷ ( 1 + 2 ) 6 ÷ ( 3 ) 2
- ColinDabritz 15y agoDon't forget the division being done. The iPhone appears to operate this way: 6 6% 6%2 6%( At this point the 2 (or any value in that slot) has been dropped 6%(1 6%(1+ 6%(1+2 6%(1+2) and the result is processed in this order: 6%(3) 6%3 2 giving the result. It appears what most people are objecting to is that it performs an unexpected operation when it discards the value at 2 (because opening the parenthesis without giving 2 an operator has been designed to be 'invalid') but it does NOT indicate this in ANY way. It is also interesting to note that all of his other examples had the entire formula written out, where the iPhone did not. If it had, it would have been more clear when the 2 was dropped.
- pixelbath 15y agoAndroid inserts the implied multiplication symbol when you open parentheses (on Gingerbread 2.3.5).