[issue12211] math.copysign must keep object type.

Mark Dickinson report at bugs.python.org
Sat Jun 4 16:43:29 CEST 2011


Mark Dickinson <dickinsm at gmail.com> added the comment:

How about something like: "Return a float with the magnitude of x but the sign of y."?

The behaviour of math.copysign with respect to non-float inputs matches that of almost all the other math module functions:  integer arguments are first converted to floats, and then the underlying libm function applied.  I'm not convinced that changing the behaviour of copysign to produce integer results for integer argument would be a good idea.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12211>
_______________________________________


More information about the Python-bugs-list mailing list