Closed lewie-donckers closed 2 years ago
I wouldn't just remove the old
sign
function. There are a lot of places where it could be used.If you grep for
sign
you see a lot of these constructionscopysign(1.0, somevalue)
Which could be replaced by
sign(somevalue)
While I think refactoring those copysign()
calls is a great idea, I don't think we should keep the function because we might need it in the future.
We know it existed (we can refer to it in an issue to request the refactor) so we can retrieve it when we want to use it again. But for now, it is dead code.
Replaced helper function
sign()
.I saw three (minor) problems with it:
So I replaced it with a function that does exactly that with a descriptive name and an intuitive return type/value.