Mistake in Manual or Im too stupid??

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Mistake in Manual or Im too stupid??
Apprentice
Member # 4754
Profile #0
So I was reading editors manual and Im pretty confused about following sentence:

'However, operations are done from right to left, instead of the usual left to right (so 9 – 3 – 3 is 0, not 3, because the subtraction on the right is done first).'

Ok dont tell me why its right to left, lets leave it, but HOW is '9 – 3 – 3 = 0'??
Please someone explain to me.

[ Thursday, July 22, 2004 10:00: Message edited by: Tavadi ]
Posts: 12 | Registered: Wednesday, July 21 2004 07:00
Off With Their Heads
Member # 4045
Profile Homepage #1
It's not. This is an error in the docs. The point is to put parentheses around EVERYTHING, rather than relying on normal Order of Ops to save you.

9 - (3 - 3) = 9
(9 - 3) - 3 = 3
9 - 3 - 3 = ????

I haven't tried the last one, but it really doesn't matter. Don't leave numbers naked. Use parentheses. That's all it's trying to say.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Warrior
Member # 2838
Profile #2
I think that what he meant was this:

9 - (3 + 3) = 9 - 6 = 3

Negative three minus negative three is negative 6.

[ Thursday, July 22, 2004 11:18: Message edited by: magoicochea ]

--------------------
…../|,-‘`¯¯`\(o)_\,----,,,_………
…( `\(o),,_/` ¯ : o : :: o`-, … I'm under your bed.
Posts: 118 | Registered: Wednesday, April 2 2003 08:00
Infiltrator
Member # 4637
Profile Homepage #3
This mistake was already pointed out in another thread. :) And you'll find more mistakes. ;)

--------------------
Visit the Blades of Avernum Center
and the Beta Testing Center

--------------
"Beware lest anyone cheat you through philosophy and empty deceit, according to the tradition of men, according to the basic principles of the world, and not according to Christ." Colossians 2:6-9
Posts: 483 | Registered: Tuesday, June 29 2004 07:00
Agent
Member # 2820
Profile #4
The terms are just being evaluated from right to left. Usually, 1+2+3 means
(1+2)+3 because it is done left to right
But with Jeff's system it is
1+(2+3)

2+3*6 usually means
2+(3*6) because of order of operations, and it should still apply in Jeff's system

But that is an error in the docs because 9-3-3 should be 9+(-3-3) which is 3.

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Warrior
Member # 2838
Profile #5
Yes, the mistake is that he may have thought that it was 3*3

--------------------
…../|,-‘`¯¯`\(o)_\,----,,,_………
…( `\(o),,_/` ¯ : o : :: o`-, … I'm under your bed.
Posts: 118 | Registered: Wednesday, April 2 2003 08:00
Agent
Member # 2820
Profile #6
But then you have to consider that the statement also said 9-3-3=3! (9-3)-3 is so very different from 9-(3*3).

In reality, the direction of interpretation shouldn't matter as long as the order of operations apply, (Addition, Subtraction, Multiplication, Division; the positive operator must always have precedence)

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Apprentice
Member # 4754
Profile #7
Damn! I just graduated from Physics and Mathematics School and Im still confused! :confused:
Posts: 12 | Registered: Wednesday, July 21 2004 07:00
Off With Their Heads
Member # 4045
Profile Homepage #8
Just use parentheses everywhere to tell BoA what order you want things to be evaluated, and you'll be fine. Both in regular math and in BoA,

9 - (3 - 3) = 9

and

(9 - 3) - 3 = 3.

Everything else is superfluous if you just use a lot of parentheses.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00