I've got sample code
double k=3.14, l=0.5, m=1.3333;
System.out.println(k+":"+k%1);
System.out.println(l+":"+l%1);
System.out.println(m+":"+m%1);
which results in output:
3.14:0.14000000000000012
0.5:0.5
1.3333:0.33329999999999993
Why is it so? I expected x%1 to return non-integer part of the value of x?