This might be a silly question, but I really have an issue here with 0 and minus 0.
I am calculating a slope of a function and depending on the vector ( right or left ) it is 0 or -0.
Is it possible to do a if condition and find out if the slope is 0 or -0 ? Doing the below doesnt work.
if ( slope == 0.0f )
std::cout << "direction vector towards right";
else if ( slope == -0.0f )
std::cout << "direction vector towards left"
I deliberatly didnt put working source code, because I think it is irrelevant for the question. A simple answer for the above will help.