Which happens first?

Steve Holden sholden at holdenweb.com
Sat Apr 7 17:04:14 EDT 2001


"Lloyd Hugh Allen" <vze2f978 at mail.verizon.net> wrote in message
news:3ACE89D7.9106E941 at mail.verizon.net...
> John Yeager wrote:
> >
> > I know that this may be a dumb questio, yet I am new to programming and
I
> > am courious in a mathmatical expression such as  ( 16 * ( 15j + ( 4.2 -
> > 3.9 ) + 20  ) / -2 ) % 5 which happens first is the () or is it the
> > conversion to the complex number?? I would think it would be the ()
>
> US folks use the convention "PEMDAS", "Please excuse my dear aunt
> sally", to remember <parentheses> <exponents> <multiplication, division>
> <addition, subtraction>.
>
> Aussie folks (according to some mailing list a year or two ago--maybe AP
> Calc?) use "GEMA": <grouping> <exponents> <multiplication> <addition>.
>
The UK, of course, *has* to be different. The father of one of my friends
was a maths teacher, who was saddled with the nickname BODMAS, which is the
UK version: brackets, of, divide, multiply, add, subtract. Of course it
should really have been B<ODM><AS> to indicate some operators have equal
priority, but you can't have everything.

regards
 Steve






More information about the Python-list mailing list