System.out.println("3.14 - 5 = " + (3.14 - 5));
This statement shows 3.14 - 5 = -1.8599999999999999 in console when the answer is -1.86.
How would I be able to fix this error and what is the reason for the wrong answer being printed in the first place?
Thanks for answering my question, even though it's probably very simple :/.