I have a double value and I need to divide it with an integer value. I need the result to be an integer value again. Then I need to perform modulo division on the double value to get the reminder. I got the following code:
double num = in.nextDouble();
int div = num/20.0;
int modulo = num%20.0;
System.out.println("div= "+div);
System.out.println("modulo= "+modulo);
error: possible loss of precision
int div = num/20.0;
error: possible loss of precision
int modulo = num%20.0;