I have the following code :
Double x = 17.0; Double y = 0.1; double remainder = x.doubleValue() % y.doubleValue();
When I run this I get r
You need to compare your result which allows for rounding error.
if (remainder < ERROR || remainder > 0.1 - ERROR)
Also, don't use Double when you mean to use double
double