I'm working on a calculator in Java but the "." buttons function won't work. if I remove the Math.round()
I sometimes get 1.1999999 instead of 1.2. How do I solve this problem? I've tried looking up several Math.round()
solutions on stack overflow but none of them worked.
x = Math.round(x + (y / (Math.pow(10, z)) * 1000) / (double) 1000);
the code above is what I've tried so far.