So today I noticed something unexpected in java:
long a = 1234567890000l;
float b = 1.2f;
long result_a = (long)(a - b * 1000);
long result_b = a - ((long) (b * 1000));
System.out.println("result_a: " + result_a);
System.out.println("result_b: " + result_b);
You would expect result_a and result_b to be similar (not exactly the same since b is float and not precise by definition), right? right?? Well, no...
result_a: 1234567954432
result_b: 1234567888800
No idea why the huge difference. Any ideas guys?