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/2002-October/029216.html below:

PEP239 (Rational Numbers) Reference Implementation and new issues

[Python-Dev] Re: PEP239 (Rational Numbers) Reference Implementation and new issues [Python-Dev] Re: PEP239 (Rational Numbers) Reference Implementation and new issuesSkip Montanaro skip@pobox.com
Sat, 5 Oct 2002 20:01:12 -0500
    >> If Guido was adding complex numbers today instead of long ago, I
    >> wonder if he would allow a special notation for them, or just suggest
    >> a constructor.

    Guido> At the time I believe there was heavy pressure from the Numeric
    Guido> crowd to allow a special notation.  I'm not so sure if I should
    Guido> have given in though.

However, 1+4j can be peephole optimized into a compile-time constant whereas
complex(1,4) can't.  This is generally not a big deal, but to people who
deal with complex numbers a lot (and tend to be more sensitive to
optimization issues) it can be.  I believe when I tested my peephole
optimizer using pybench several years ago, the complex number tests showed
the most improvement because I could collapse constant expressions.

Of course, people using lots of complex numbers probably initialize their
complex constants outside of loops. ;-)

Skip




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