Mark Dickinson dicki...@gmail.com added the comment:
Fixed in r83400, r83401, r83402.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9416
New submission from Mark Dickinson dicki...@gmail.com:
format(complex(-0.0, 2.0), '.10') # expected '(-0+2j)'
'(+2j)'
format(complex(-0.0, 2.0), '') # gives expected result
'(-0+2j)'
--
assignee: mark.dickinson
messages: 111923
nosy: eric.smith, mark.dickinson
priority: normal
Changes by Mark Dickinson dicki...@gmail.com:
--
components: +Interpreter Core
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9416
___
___
Mark Dickinson dicki...@gmail.com added the comment:
Here are some tests.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9416
___
___
Changes by Mark Dickinson dicki...@gmail.com:
--
keywords: +patch
Added file: http://bugs.python.org/file18252/issue9416_tests.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9416
___
Mark Dickinson dicki...@gmail.com added the comment:
And here's a fix (includes the earlier tests, along with some fixes to the
tests themselves).
--
stage: unit test needed - patch review
Added file: http://bugs.python.org/file18254/issue9416.patch
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
I wonder if complex addition/subtraction should preserve -0.0 when it is added
to a purely imaginary number. I.e.,
-0.0+1j
(-0+1j)
--
nosy: +belopolsky
___
Python tracker
Mark Dickinson dicki...@gmail.com added the comment:
Well, that's a separate issue, so should have its own feature request. The
main difficulty is that Python has no notion of a 'pure imaginary' type: one
would have to implement such a type to get this behaviour.
C99 defines the _Imaginary