There seems to be some IEEE 754 floating point precision specifications I'm missing
When you use (int)
it truncates the fractional part no matter how close it is to the next whole value. It is not reversible as information is lost, so it should be no surprise that you don't get the same result.
What you could do instead is the following
double o = 2.3;long l = Math.round(o * 100000.0);double d = l / 100000.0;System.out.println(d);
jvm optimizations that inlines ... making this a no-op
The JVM might optimise it, but it won't change the result. If an optimisation changes the outcome it is a bug in the optimiser.