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; }
This is a discussion on Why illegal use of floating point? within the C++ Programming forums, part of the General Programming Boards category; Hello, why there is illegal use of floating point?and what can be done to resolve it? Code: #include <iostream.h> int ...
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.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
Ok thanks laser..!