[Python-ideas] Re: math.copysign not to introduce float

2019-12-04 Thread Marein
Thanks for all the input! I don't know if I agree that it's a slippery slope, since copysign seems to me of a different nature compared to e.g. sin. How important to use this: Many languages do feature a sign function, if that's of any worth. copysign is python's closest built-in equivalent. I d

[Python-ideas] math.copysign not to introduce float

2019-11-28 Thread Marein
The math.copysign(x, y) function always returns a float, even when the given x is an int, i.e. math.copysign(3, -1) gives -3.0. This is documented behaviour, but I find it somewhat surprising given that the name suggests that it only copies a sign, and it's also annoying in situations when an int i