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 skrah
Recipients mark.dickinson, skrah
Date 2009-11-07.20:41:37
SpamBayes Score 1.6336621e-07
Marked as misclassified No
Message-id <1257626499.13.0.928047451376.issue7281@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry to report so many obscure corner cases. With the combination
Opensolaris/suncc/Python3.x copysign() gives reversed results when the
second argument is a NaN. The bug is in the C99 copysign() function
(OpenSolaris/suncc), but Python2.6 seems to have a workaround: 

Python 3.2a0 (py3k:76144, Nov  7 2009, 18:50:00) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> from math import *
>>> copysign(1.0, float("nan"))
-1.0
>>> copysign(1.0, float("-nan"))
1.0

Python 2.6.2 (r262:71600, Nov  7 2009, 19:29:52) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> from math import copysign
>>> copysign(1.0, float("nan"))
1.0
>>> copysign(1.0, float("-nan"))
-1.0
>>>
History
Date User Action Args
2009-11-07 20:41:39skrahsetrecipients: + skrah, mark.dickinson
2009-11-07 20:41:39skrahsetmessageid: <1257626499.13.0.928047451376.issue7281@psf.upfronthosting.co.za>
2009-11-07 20:41:38skrahlinkissue7281 messages
2009-11-07 20:41:37skrahcreate