I have the code bellow and I get as output:
30.299999999999997
30
Why is the output:30.299999999999997 and not 30.3?
public class demo { private static double som(double a, double b) { return a+b; } private static int som(int a, int b) { return a+b; } public static void main(String args[]) { System.out.println(som(20.20,10.10)); System.out.println(som(20,10)); } }