In the JVM, does the separation between two double values always give the exact same result as the whole division?
With the following prerequisites:
- Department without a trace
- No division by zero
- Both
xand yreally contain integers.
eg. in the following code
double x = ...;
int resultInt = ...;
double y = x * resultInt;
double resultDouble = y / x;
is it resultDoublealways equal resultIntor may there be some loss of accuracy?
Chris source
share