I am building one calculator and facing this basic problem. How can I get the number when I am doing square root and then square of that number. Here is the problem and help me to get the number back after doing square.
public static void main(String[] args) {
double aa = 3;
System.out.println(aa); // output 3.0
double bb = Math.sqrt(aa);
System.out.println(bb); // output 1.7320508075688772
double cc = Math.pow(bb, 2);
System.out.println(cc); // output 2.9999999999999996, why not 3 ??
}