New submission from Stefan Krah <stefan-use...@bytereef.org>: 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 >>> ---------- messages: 95027 nosy: mark.dickinson, skrah severity: normal status: open title: copysign() with NaN arguments on OpenSolaris type: behavior versions: Python 3.1, Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7281> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com