On 8/29/07, Dirkjan Ochtman <[EMAIL PROTECTED]> wrote: > Alexandre Vassalotti wrote: > > C doesn't have an exponentiation operator. You use the pow() function, > > instead: > > Wouldn't it make more sense, then, to have unary +/- have higher > precedence than the ** operator, so that -3**2 == 9?
No, that would have been really bad. Anyone who's had high school algebra expects -x**2 to be -(x**2) and not (-x)**2. I think the weirdness comes from parsing -a/b as (-a)/b rather than -(a/b). It should be the latter, if compatibility with math notation is more important than compatibility with C. Oh well. Maybe in Python 4. :) -j _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com