homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients josh.r, mark.dickinson, rhettinger, rushilu, steven.daprano, tim.peters
Date 2020年04月13日.03:22:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586748161.06.0.543862650584.issue40269@roundup.psfhosted.org>
In-reply-to
Content
Would we be willing to consider an enhancement to have complex numbers always display using float format rather than ints?
 1+1j --> 1.0+1.0j
We could still suppress an unsigned real zero:
 1j --> 1.0j
but negative zero would show:
 -(1j) --> -0.0-1.0j
I daresay this would break some doctests (CC'ing Tim, as he is a heavy user of doctests) but perhaps it would be worthwhile.
Aside from the backwards-compatibility issue, going against this suggestion we have the popular Texas Instruments Nspire calculator, which shows complex numbers as ints when possible.
On the other hand, the imaginary unit is shown as the symbolic constant i with no coefficient, and it also shows complex numbers with an explicit multiplication sign: 2⋅i rather than 2i.
Similarly, Julia shows complex numbers with integer coefficients when possible:
https://docs.julialang.org/en/v1/manual/complex-and-rational-numbers/ 
History
Date User Action Args
2020年04月13日 03:22:41steven.dapranosetrecipients: + steven.daprano, tim.peters, rhettinger, mark.dickinson, josh.r, rushilu
2020年04月13日 03:22:41steven.dapranosetmessageid: <1586748161.06.0.543862650584.issue40269@roundup.psfhosted.org>
2020年04月13日 03:22:41steven.dapranolinkissue40269 messages
2020年04月13日 03:22:40steven.dapranocreate

AltStyle によって変換されたページ (->オリジナル) /