Steven D'Aprano added the comment: If this is added, should this signum function be the two value version that returns 1 for zero, or the three value version that returns 0? Should it distinguish between signed zeroes +0.0 and -0.0? What should it do for NANs (raise, return a NAN, copy the sign bit from the NAN)?
The argument for adding this will be slightly stronger if other languages have this, and especially if it is part of the standard C maths library. In any case, there's only a few more days until the 3.6 feature freeze, so unless you have an implementation and tests ready to go, the earliest it could be added will be 3.7. Serhiy: if this gets added, then it would make sense to add cmath.signum to handle complex numbers. ---------- nosy: +steven.daprano _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27739> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com