public class SimplePrint {
public static void main(String[] args) {
long i = System.currentTimeMillis();
System.out.println(i);
float h = 0.0f;
i -= h;
System.out.println(i);
}
}
The output is:
1477904636902
1477904695296
but when i changed the data type of variable of h
public class SimplePrint {
public static void main(String[] args) {
long i = System.currentTimeMillis();
System.out.println(i);
double h = 0.0f;
i -= h;
System.out.println(i);
}
}
the output is changed:
1477904677513
1477904677513
why is this ???