Buy an Axon, Axon II, or Axon Mote and build a great robot, while helping to support SoR.
0 Members and 1 Guest are viewing this topic.
3^2 is 3*3 so if you rewrite it as -3*3 it may be easier to see (knowing that * and / has priority over + and -).
I'd always follow the practice of piling on parentheses to remove any doubts.
It doesn't matter what rules something should or should not follow you never really know (or remember)______Rob
sure any programmer can easily understand something like: a + b * c - d / e, without the need for brackets: (a + (B * C)) - (d / e). IMO, the first statement is easier to read too.
Shouldn't the calculation simply follow the 'BEDMAS' (or any other permutation for the word) standard for operations? (brackets, exponents, division/multiplication, addition/subtraction).
uh, doesn't multiplication come before division? Please Excuse My Dear Aunt Sally.
doesn't multiplication come before division?
the order of evaluation isn't specified
Other programming languages could have different rules.
QuoteI'd always follow the practice of piling on parentheses to remove any doubts.seconded; ive had issues with my TI-84 [...]
I was always taught that division precedes multiplication using the PEDMAS or BEDMAS acryonym, for paper math at least!Quote from: Admin on March 22, 2011, 03:54:44 PMuh, doesn't multiplication come before division? Please Excuse My Dear Aunt Sally.