[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-12-11 Thread Mark Dickinson

Mark Dickinson [EMAIL PROTECTED] added the comment:

Merged to 2.6 and 3.0 maintenance branches (r67700, r67701).

--
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-12-10 Thread Martin v. Löwis

Martin v. Löwis [EMAIL PROTECTED] added the comment:

Unless Facundo or some of the other decimal contributors reviews and
applies this patch really quickly, it is out of scope for 2.5.3.

--
nosy: +loewis

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-12-10 Thread Facundo Batista

Facundo Batista [EMAIL PROTECTED] added the comment:

Commited in trunk and Py3, thanks Mark!

Please, could you commit it in 2.5? The only change I've made in the
patch is adding the issue number to Misc/NEWS, the rest is ok.

After that, just close this.

Thanks again!

--
versions:  -Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-12-10 Thread Martin v. Löwis

Martin v. Löwis [EMAIL PROTECTED] added the comment:

Mark, if you want to backport this, please go ahead. If want me to,
assign to me.

--
assignee: facundobatista - marketdickinson
priority: normal - release blocker

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-12-06 Thread Mark Dickinson

Changes by Mark Dickinson [EMAIL PROTECTED]:


--
versions: +Python 3.1

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-10-09 Thread Mark Dickinson

New submission from Mark Dickinson [EMAIL PROTECTED]:

Here's a snippet from Python 2.6:

 from decimal import Decimal, getcontext
 getcontext().prec = 3
 Decimal('NaN').max(Decimal('1234'))
Decimal('sNaN234')

The result here should be Decimal('1.23E+3')---the specification says that 
the result of comparing a quiet NaN with a finite value should be that 
finite value, rounded according to the context.

This also affects min, max_mag and min_mag.

The cause is that non-NaNs are incorrectly being passed to the _fix_nan 
method.  The attached patch fixes this, and adds new testcases to 
extra.decTest to stop it happening again.

It would be good to get this fix into 3.0, if possible.  I think it should 
also be backported to 2.5.3.

--
assignee: facundobatista
files: decimal_maxbug.patch
keywords: patch
messages: 74557
nosy: facundobatista, marketdickinson
priority: normal
severity: normal
status: open
title: Decimal.max(NaN, x) gives incorrect results when x is finite and long
type: behavior
versions: Python 2.5.3, Python 2.6, Python 2.7, Python 3.0
Added file: http://bugs.python.org/file11753/decimal_maxbug.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com