![]() |
![]() |
#1 |
Dec 2012
The Netherlands
111000011112 Posts |
![]()
We all know that different processors may give different answers when evaluating -3 mod 2.
But it was news to me that calculators differ in their evaluation of 8รท2(2+2): https://www.nytimes.com/2019/08/02/s...as-bedmas.html They avoid trying to explain to a general audience that \(2^{2^3}=256\)... |
![]() |
![]() |
![]() |
#2 |
Jun 2003
153C16 Posts |
![]()
8รท2(2+2) is an inconsistent notation, mixing explicit division operator and implicit multiplication operator, so naturally there can be differences in the interpretation.
|
![]() |
![]() |
![]() |
#3 |
Bamboozled!
"๐บ๐๐ท๐ท๐ญ"
May 2003
Down not across
89·131 Posts |
![]() |
![]() |
![]() |
![]() |
#4 |
"Rashid Naimi"
Oct 2015
Remote to Here/There
44408 Posts |
![]()
Takes away the ambiguity by giving precedence to division over multiplication, which are actually meant to have equal precedence which by original (before democratically acronym based convention) convention should be evaluated left-to-right, whichever comes 1st.
|
![]() |
![]() |
![]() |
#5 |
"Rashid Naimi"
Oct 2015
Remote to Here/There
233610 Posts |
![]()
I think it is ok for the masses to democratically decide who the experts are, but not to democratically decide what the expert-opinion is and leave that part to the experts in the field. Otherwise we get Wikipedia.
![]() Last fiddled with by a1call on 2019-08-03 at 14:36 |
![]() |
![]() |
![]() |
#6 | |
"Rashid Naimi"
Oct 2015
Remote to Here/There
25·73 Posts |
![]() Quote:
![]() Last fiddled with by a1call on 2019-08-03 at 20:28 |
|
![]() |
![]() |
![]() |
#7 | |
∂2ω=0
Sep 2002
Repรบblica de California
2DEB16 Posts |
![]() Quote:
I tested both the expression in the OP and 2^3^4 using Posix bc, it conforms to the PEMDAS, including the above rule for exponentiation. In related flamebait news, is it good or bad that C gives << and >> different priority than * and /? |
|
![]() |
![]() |
![]() |
#8 |
"Kebbaj Reda"
May 2018
Casablanca, Morocco
32×11 Posts |
![]()
Reading direction 8รท 2(2+2).
https://www.mersenneforum.org/showth...038#post523038 Last fiddled with by Kebbaj on 2019-08-04 at 03:07 |
![]() |
![]() |
![]() |
#9 | |
Dec 2012
The Netherlands
13×139 Posts |
![]() Quote:
In my experience, code involving shifts also uses other bitwise operators so you end up needing brackets anyway, e.g. Code:
t=(p<<5|p>>27)+(q&r^~q&s)+t+0x5a827999+tedoen[0];q=q<<30|q>>2; |
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rationality of an expression | jnml | Miscellaneous Math | 7 | 2018-09-06 15:57 |
A Fib expression with multiplication | MattcAnderson | Homework Help | 5 | 2016-11-01 08:16 |
Theoretical Evaluation of a GPU | tapion64 | PrimeNet | 10 | 2014-04-09 22:21 |
regular expression help | ixfd64 | Programming | 2 | 2009-03-01 06:19 |
Does Anyone Know how to Simplify the Following Expression? | jinydu | Puzzles | 9 | 2004-04-02 01:03 |