really silly nit: why 3+5j instead of 3+5i?

Konrad Hinsen hinsen at cnrs-orleans.fr
Mon May 15 05:22:39 EDT 2000


"Tim Peters" <tim_one at email.msn.com> writes:

> [Jeff Petkau]
> > Can anyone tell me why Python uses 'j' instead of 'i' for imaginary
> > numbers?
> 
> Because consensus on this was impossible to reach, and it appeared that more
> people favored "j" than "i" at the time.

Exactly. A bit of history for the youngsters among us: The question of
adding a complex number type to Python came up during the early days
of Numerical Python, in 1995 or so. I wrote the original
implementation patches, which involved a change to the parser (to
recognize imaginary constants) as well as the addition of a new type
and the module cmath. In that version, both i and j (as well as their
upper-case variants) were allowed, trying to please everyone.

There was then a lengthy discussion (in this group) whether the
complex type should become part of the core language at all. The
question was decided by Guido (who else?), who accepted the complex
type but insisted on a single spelling for the constants (except for
case differences, as number constants in Python are not case
sensitive). In a subsequent discussion on the MatrixSIG mailing list,
it turned out that physicists and mathematicians were more flexible
than electrical engineers <, and the j suffix was adopted as the only
spelling.

we-should-start-writing-a-book-on-the-history-of-Python-ly y'rs  - Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------



More information about the Python-list mailing list