It might be a dumb question, but I really have a problem with 0 and minus 0.
I calculate the slope of the function and depending on the vector (right or left) is 0 or -0.
Is it possible to fulfill the if condition and find out if the angle of inclination is 0 or -0? The execution below does not work.
if ( slope == 0.0f )
std::cout << "direction vector towards right";
else if ( slope == -0.0f )
std::cout << "direction vector towards left"
I intentionally did not use working source code, because I think it does not matter for the question. A simple answer to this will help.
source
share