The program outputs the roots of a quadratic equation:
System.out.printf(Locale.US, "%.4f %.4f", x2,x1); In addition to simple output, it also rounds the number with an accuracy of 10^-4 . But I need exactly “with accuracy”, i.e. WITHOUT CIRCULATION. How to do it?
%.4fpattern rounds ( round ) the value to 4 characters, and the vehicle wants to truncate it to 4 characters. - Nofate ♦