CC complier gives me
invalids operands to binary %
error
Code:
if((m%(f_accept*N))==0.0)
{...
.....
}
Printable View
CC complier gives me
invalids operands to binary %
error
Code:
if((m%(f_accept*N))==0.0)
{...
.....
}
% can only be used with integer values/variables. Maybe you should lookup fmod().
Can you explain more? Here f_accept is double and m and N are basically integers.
There's a difference between "int" and "basically integers". The things on the left and the right of % must be ints. Since f_accept is not an int, neither is f_accept*N.
Ok that means i need to use fmod() function to get the remainder.
Or, if they're "basically integers", you could cast to int or something like that.
If you use fmod(), don't forget to include math.h . . . .