I'm currently learning lava and i have been playing around with some simple tasks.
Code:
public class Main { public static void main(String args[]){ int counter = 0; double number = 0; while (counter <= 10){ number += .2; System.out.println(number); counter++; } } }
Output:
0.2 0.4 0.6000000000000001 0.8 1.0 1.2 1.4 1.5999999999999999 1.7999999999999998 1.9999999999999998 2.1999999999999997
Why does the output have uneven values?