I wish this help you The C++ standard permits an implementation to evaluate floating-point expressions with more precision than is required by the nominal format. For example, float expressions may be evaluated as if they were double or more, and double expressions may be evaluated as if they were long double. This extra precision can cause differences in evaluation, especially where discontinuous functions (such as conversion to int) are used.

For example, given y = 89, y / 10.0 - y / 10 would be .9 in real-number arithmetic, but it is 0.9000000000000003552713678800500929355621337890625 in double (IEEE-754 binary64) arithmetic and 0.89999999999999999965305530480463858111761510372161865234375 in long double (Intel’s 80-bit format) arithmetic, and then multiplying by 10 and converting to int produces 9 or 8, respectively.

code :

```
int foo = (double) ((double) (y / 10.0) - y / 10) * 10;
int bar = (double) ((double) (89 / 10.0) - 89 / 10) * 10;
```