That one can return positive or negative for zero... Which some algorithms probably need, but again isn't optimal or desirable for other cases.http://en.cppreference.com/w/cpp/numeric/math/signbitI'll remeber to call my function sign_bit if I ever write that "optimized" version
Guess I'm down to sign_dichotomy :lol:
Unless your platform doesn't like mixing register types - after working with PowerPC, I'm wary, as code like that would stall the CPU :oI agree that the sign of a floating point number is a binary result; either a positive sign or a negative sign, so boolean is a better return type... or an enum with two choices if you prefer. If you have it, use std::signbit() to do it.
A lot of algorithms will also probably assume or rely on zero having a single defined result, instead of the result changing depending on how you computed that zero.