Mark Dickinson <[email protected]> added the comment:
I disagree that this is useful enough to make it worth adding to the standard
library. Between math.copysign and simple comparisons, I think all the common
cases are well covered. And it's a simple one-line function:
def signum(x):
return (x > 0) - (x < 0)
Frank, do you have any convincing use-cases that aren't already covered by
math.copysign or simple two-way comparisons (e.g., x >= 0)?
----------
nosy: +mark.dickinson
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue829370>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com