48÷2 (9+3) argument

you're not really good at basic maths for a programmer

lol_cat-12926.jpg

Like I said, use brackets, otherwise it just looks wrong no matter how you do it. Ambiguity in logic is not clever. People who think it is, are bad programmers.

Also, if you use brackets, noone needs to know the order of operator precedence. So my way is the best method. End of ^_^
 
Last edited:
Now I'm a developer and writing code all day long puts me in a certain mindset. In a psudo language you will agree that if I could be allowed to use a number as a function name (which languages like erlang allow you to do) then the following is true:

Code:
function 2(A) {  return 2*A; }

So my code of :
Code:
print 2(9+3)

Returns:
Code:
24

Now if I run the code of:
Code:
print 48/2(9+3)

I get:
Code:
2

Think about it
 
Scary to note that most of you guys got it wrong (considering that many of you are in the IT industry) and this is really basic maths.
 
Note how 16 ÷ 2[8 – 6] is reduced to 16 ÷ 4. That is because the 2 is part of the brackets. If we did it your way, then 16 ÷ 2 would be evaluated first.

Hate to say it, but you might actually have a point. The author of the page you referred to however says:

Note that different software will process this differently; even different models of Texas Instruments graphing calculators will process this differently. In cases of ambiguity, be very careful of your parentheses, and make your meaning clear. The general consensus among math people is that "multiplication by juxtaposition" (that is, multiplying by just putting things next to each other, rather than using the "×" sign) indicates that the juxtaposed values must be multiplied together before processing other operations. But not all software is programmed this way, and sometimes teachers view things differently. If in doubt, ask!

(And please do not send me an e-mail either asking for or else proffering a definitive verdict on this issue. As far as I know, there is no such final verdict. And telling me to do this your way will not solve the issue!)

So this is a recognized area of uncertainty and as such, you are not completely right. The general consensus (with which I will now agree), however support your point of view.

Well Done! :p
 
The answer is 2. think of it like this y/x(x)=y/x^2.it won't be y/x times x/1 which would be y/1. Agreed??
 
Hate to say it, but you might actually have a point. The author of the page you referred to however says:



So this is a recognized area of uncertainty and as such, you are not completely right. The general consensus (with which I will now agree), however support your point of view.

Well Done! :p
Thank you for my badge, kind sir :)

Anyway screw this, it's Friday evening and I'm off to jam some Dragon Age 2 :D
 
A /x(b+c)=a/xb+xc. This is distributive properties
 
Scary to note that most of you guys got it wrong (considering that many of you are in the IT industry) and this is really basic maths.

Nah. As I said, according to this page, not everybody agrees about this. There is uncertainty and therefore it is not as simple as "this is really basic maths".


I get..who gives a ****

Quite a few of us, it seems ;)
 
Last edited:
The question is whether the (9+3) is taken as part of the numerator or denominator. As it stands it is ambiguous, so there is no right or wrong answer. Calculators can't answer "ambiguous" so the designers simply pick one & go with that. Different designers pick different options.

As HT said, it needs brackets for clarity.

If forced to choose though:
If the ÷ is taken to apply to everything that follow, the (9+3) is in the denominator, if the ÷ is just applied to only the single term following it (the 2) then the (9+3) is in the numerator. Since adding brackets after the ÷ would make it the earlier, I'd said by default no brackets makes it 288.

Google doesn't fking lie!
Actually....
http://www.google.com/search?hl=en&q=2999999999999999-2999999999999991&btnG=Search

Also, how the fk did this thread get to 7 pages in the time frame between now & me last checking mybb.:wtf:
 
me thinks the problem is with too much syntax freedom..

these listed below all mean the same thing:
2(9+3) = 2.(9+3) = 2x(9+3) = 2*(9+3)

it's only when the "48/" gets introduced in front where it suddenly becomes a difference.
 
me thinks the problem is with too much syntax freedom..

these listed below all mean the same thing:
2(9+3) = 2.(9+3) = 2x(9+3) = 2*(9+3)

it's only when the "48/" gets introduced in front where it suddenly becomes a difference.

Why the **** are we doing maths on a Friday night? o.0
 
I see it as:
48 / (2(9+3)) = 2
If you get anything else you need to go back to matric... or stop using advanced theoretical maths :p
 
Top
Sign up to the MyBroadband newsletter
X