i'm new here and to Java Android Studio.
Currently i creating an App which functions as below :
- User key-in a digit for example 1131
- The App will take 1131 / 80 = 14.1375
- And the calculation will remove all the front digit which is the 14
- Use 0.1375 and Times 80
- Results = 11
- Then the App will display a certain message for the number 11
So far i'm stuck at the calculation which is For Example :
int x = 1131;
double x1 = x / 80.0; //Gets 14.1375
double x2 = Math.floor(x1); //Gets 14.0
double x3 = x1 - x2; //14.1375 - 14.0 = 0.1374999999999993 ???
something weird shows up during the Math.floor, it suppose to take 14 and execute x1 - x2 ( 14.1375 - 14.0 = 0.1375 )
But instead it shows 0.1374999999999993
Thank you !!