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.

classification
Title: decimal.py: incorrect results in NaN comparisons
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: mark.dickinson, skrah
Priority: normal Keywords:

Created on 2009-08-28 10:15 by skrah, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg92032 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2009-08-28 10:15
Hi,

I believe the following comparisons aren't correct:

1:

Decimal("-sNaN63450748854172416").compare_total(Decimal("-sNaN911993"))
==> Decimal('1')

Should be: Decimal('-1') (checked against decNumber)


2:
Decimal("NaN1222222222222").compare_total_mag(Decimal("-NaN999999"))
==> Decimal('-1')

Should be: Decimal('1') (checked against decNumber)
msg92036 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-08-28 13:44
Thanks for the report!  I've applied a quick fix in the trunk in r74564; 
merged to other branches in r74565 (release26-maint), r74566 (py3k) and 
r74567 (release31-maint).
History
Date User Action Args
2022-04-11 14:56:52adminsetgithub: 51043
2009-08-28 13:44:57mark.dickinsonsetstatus: open -> closed
resolution: fixed
messages: + msg92036

stage: resolved
2009-08-28 11:24:14mark.dickinsonsetassignee: mark.dickinson
versions: + Python 2.6, Python 3.1, Python 2.7, Python 3.2
2009-08-28 10:18:20ezio.melottisetpriority: normal
nosy: + mark.dickinson
type: behavior
2009-08-28 10:15:03skrahcreate