I'm having trouble with the abs function. I have two variables - my_abs_minimum and r, both are type double. I need to compare my_abs_minimum to the absolute value of r. Here is what I am doing:
That's how this whole thing started. Without the word double, I get this warning:
"passing 'double' for converting 1 of 'int abs(int)'"
I researched the abs function and found that I needed the double to prevent it from converting back to an integer. At least, that was my conclusion, for better or worse.
Not really feasible. This is part of a fairly long class implementation and I don't know how to strip the code to something that would make the issue any simpler.
I figured out a way to solve it. Rather than mess around with casting the abs function as double, I changed my abs function call from abs to fabs. I found something that says that that is what you do when your argument is double rather than int.