CC complier gives me
invalids operands to binary %
error
Code:if((m%(f_accept*N))==0.0) {... ..... }
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 . . . .
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.