Hello,
why there is illegal use of floating point?and what can be done to resolve it?
Code:#include <iostream.h> int main(void) { long double n=234234243234234,i=1221212121,k; k=n%i cout<<k ; return 0; }
Hello,
why there is illegal use of floating point?and what can be done to resolve it?
Code:#include <iostream.h> int main(void) { long double n=234234243234234,i=1221212121,k; k=n%i cout<<k ; return 0; }
operator% is not defined for floating point types.why there is illegal use of floating point?
Use fmod() from <cmath>what can be done to resolve it?
Incidentally, <iostream.h> should be <iostream>, and I am guessing that 234234243234234 is too large to be an int literal, but should be made a double literal instead.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Ok thanks laser..!