Serhiy Storchaka added the comment: See math.copysign(). https://docs.python.org/3/library/math.html#math.copysign ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue27739> _______________________________________