If you have a problem like that and don't understand the compiler error, then split the function into bit, e.g. calculate without the sqrt e.g.
double d=a+b;
distance=sqrt(d);
You have three functions in one line, not a problem BUT it is to you because you can't see what the compiler is telling you. So make it simpler and then you will see what the problem is.
The answer to your question is , yes two things. [maybe three depending on your outlook]
Finally, I ment to add that anyone who does this
float F=function();
if (F==25)
{
// This almost never gets executed
}
is asking for nasty trouble,, the reason is that a floating point number is only equal if EVERY bit is exactly the same e.g. 25.000000000001 is NOT equal to 25.0000000000. So think about how to get round that. Additionally, rounding errors in many functions will lose a little accuracy so although the answer should be exactly 25.0 you get 25.0000001 or something like that.
Additionally, although you may chose to have the sqrt function in your code, you can write it without the sqrt function, by observing that the tests like
if (sqrt(d)>10.0) is the same as
if (d>100.0) (assuming that d is positive, otherwize nasty things happen with the sqrt).