Mark Dickinson [EMAIL PROTECTED] added the comment:
New patch committed, r65518. Conversion of a nan to an integer now raises
ValueError consistently across platforms.
--
status: open - closed
___
Python tracker [EMAIL PROTECTED]
Antoine Pitrou [EMAIL PROTECTED] added the comment:
It also just feels right, to me; an attempt to convert a nan
to an integer should not pass silently.
I have the same gut feeling.
--
nosy: +pitrou
___
Python tracker [EMAIL PROTECTED]
Mark Dickinson [EMAIL PROTECTED] added the comment:
I still think this is the wrong solution, and should be fixed before 2.6;
long(float('nan')) should raise ValueError. As Alexander points out,
this fits much better with the IEEE 754 standard, and also with the C99
standard. It also just
Changes by Georg Brandl [EMAIL PROTECTED]:
--
priority: normal - critical
status: closed - open
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1481296
___
Mark Dickinson [EMAIL PROTECTED] added the comment:
Assigning to me; I'd like to check in the new fix for 2.6/3.0, but I'll
give it a couple of weeks for any objections to surface first.
--
assignee: - marketdickinson
versions: +Python 2.6, Python 3.0 -Python 2.5
Georg Brandl [EMAIL PROTECTED] added the comment:
It seems backporting this is not useful.
--
nosy: +georg.brandl
status: pending - closed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1481296
Alexander Belopolsky added the comment:
FYI: IEEE Standard 754 requires an invalid operation exception when
inf/nan conversion to integer is attempted.
--
nosy: +belopolsky
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1481296
Mark Dickinson added the comment:
A late comment: I agree with Ronald here; mightn't it make more sense
to raise an exception (ValueError?) for long(float(nan))?
For comparison, long(float(inf)) currently raises OverflowError, at
least on OS X.
--
nosy: +marketdickinson
Christian Heimes added the comment:
Fixed in r59689 trunk
Backport it to 2.5?
--
nosy: +tiran
resolution: - fixed
status: open - pending
versions: +Python 2.5 -Python 2.3
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1481296
Ronald Oussoren added the comment:
The change in the trunk seems like a good backport candidate, it fixes
an issue with float conversion on OSX compared to other platforms.
That said, I don't like the patch. This makes the current behaviour of
converting float NaN's to 0 the defined
10 matches
Mail list logo