A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-August/074371.html below:

[Python-Dev] Order of operations

[Python-Dev] Order of operations [Python-Dev] Order of operationsJason Orendorff jason.orendorff at gmail.com
Thu Aug 30 13:02:13 CEST 2007
On 8/29/07, Dirkjan Ochtman <dirkjan at ochtman.nl> 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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4