TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

3 caculators = 3 different answers to one math problem

41 点作者 msredmond大约 13 年前

16 条评论

mrgoldenbrown大约 13 年前
1 ambiguous notation, 3 different interpretations. The Casios both have reasonable interpretations, but the iPhone should probably give some kind of warning that it is about to ignore entire numbers.
评论 #3777777 未加载
评论 #3777658 未加载
xamuel大约 13 年前
Math PhD student here. The issue is that people are confusing two symbols which are distinct: the solidus (/) and the obelus (÷). The latter is rather obsolete and it's not clear why exactly calculators use it. Anyway, this blog post clears up the issue better than I could hope to in a comment: <a href="http://www.matthewcompher.com/posts/trouble-with-semantics-the-obelus-or-division-symbol-%C3%B7/" rel="nofollow">http://www.matthewcompher.com/posts/trouble-with-semantics-t...</a>
评论 #3780265 未加载
cytzol大约 13 年前
Mentally, I perform no-written-operator multiplication first, then anything else, so I can see why the calculators (and WolframAlpha, in some cases) are getting the intention wrong:<p>"6 ÷ 2x" gets parsed as "6 / (2 * x)"<p>"6 ÷ 2 * x" gets parsed as "(6 / 2) * x"<p>All that's done in the equation in the article is having a pair of brackets instead of a variable, but the result is the same to my brain.
评论 #3777498 未加载
评论 #3777787 未加载
snitzr大约 13 年前
RPN (Reverse Polish Notation) gets things done on a calculator. This article shows one reason why it's not just for finance.
评论 #3778017 未加载
Rust大约 13 年前
I enjoyed the bit at the end where the writer managed to use the wrong (IMO) formula to arrive at the correct answer.<p>Using BEDMAS as I was taught, so many moons ago:<p>6 ÷ 2 ( 1 + 2 )<p>6 ÷ 2 ( 3 )<p>6 ÷ 2 * 3 // because 2(3) is not an exponent or algebraic construct, it's straight multiplication<p>3 * 3 // division and multiplication are in left-to-right order, no precedence<p>9
评论 #3777858 未加载
评论 #3777871 未加载
ghshephard大约 13 年前
In Microsoft Excel we get:<p>"Microsoft Excel found an error in your formula you entered. Do you want to accept the correction proposed below?"<p>=6/2*(1+2)<p>Which then gives 9.
kylec大约 13 年前
Hm, Calcbot on the iPhone also returns 2 if entered without a multiplication after the first "2". Hitting the open parenthesis key removes the "2" from the calculation. Since Calcbot displays what you've entered below the answer, it's easy to see the mistake with a trivial calculation like this, but if you're not watching for it it's easy to miss. Better than the built-in calculator and PCalc, which provide no feedback and give the wrong answer, but surprising.
trjordan大约 13 年前
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.<p>But ... the iPhone gives 2? I don't get it.<p>(FWIW, Android says 9)
评论 #3777467 未加载
评论 #3777949 未加载
评论 #3777523 未加载
评论 #3777389 未加载
评论 #3777390 未加载
rometest大约 13 年前
when i was a kid, i was told to use the BODMAS rule i.e Brackets, Orders, Division or Multiply, Addition or Substraction<p>After you have done "B" and "O", just go from left to right doing any "D" or "M" as you find them.<p>Then go from left to right doing any "A" or "S" as you find them.
评论 #3777614 未加载
anonymous大约 13 年前
Multiplication and division have the same precedence, so you do them left-to-right as written. Like addition and substitution.<p>Or better yet, realise that writing it all on one line is stupid and ambiguous, and write properly.
nraynaud大约 13 年前
to me, elided multiplication has a higher precedence than the explicit one (and by transitivity, than the explicit division), but I don't remember in which grammar I read that (mathematica, matlab ?).
jonsen大约 13 年前
In WolframAlpha 6÷2(1+2) gives 9 but 6÷2x with x=(1+2) gives 1.
评论 #3777818 未加载
ernesth大约 13 年前
I would have expected an answer of 3 as 2(1+2) cannot mean anything else than applying the constant function 2 to the sum.
joejohnson大约 13 年前
Anyone have a guess to how the iPhone calculator computed 2?
评论 #3777383 未加载
评论 #3777375 未加载
评论 #3777392 未加载
hcarvalhoalves大约 13 年前
...about time we start teaching prefix notation on schools.
thekungfuman大约 13 年前
I'm happy to say my mental math and my phone's (Nexus S) math get 9.