Cast to int by truncating!
By the way if you have this pattern
Code
if (cond) {
return true;
}
else {
return false;
}
You can always change it to
Code
return cond;
In your case, the body of the function could simply be
Code
return ((int) (x * 1000) == (int) (y * 1000));
This post was edited by xapeu on Jul 28 2018 11:29am