I have a strange problem with fabs function in C code. I have two double values and I want to find the absolute value of their difference using code like this:
a = 87.967498;
b = 218.025015;
if (fabs(a-b)<2.0)
...code to execute
The value of fabs(a-b)
is an int and is equal to 1. I don't know whats the problem here and I can't find anything on the net. Any help would be great!!