I need to use '%' with double numbers, but in C ++ it does not work. Example:
double x; temp = x%10;
I get this error:
error C2296: '%' : illegal, left operand has type 'double'
How can I solve this problem without converting the number from double to integer? If I convert it, I will lose the fractional part, and I do not want to.
Is there any other alternative?
source share