Question: ```
echo 65.7 * 100 % 10 // 0

echo 65.6 * 100 % 10 // 9 <---

echo 6560 % 10       // 0

echo 65.5 * 100 % 10 // 0

```

Can someone please explain why?

**EDIT:**

for human or non-programmers, the result 9 is apprently wrong.

how can I prevent this `"error"` when programming?

Answer: 
Because `65.6` in floating point is actually an approximation of `65.6`. It is actually marginally less than `65.6`, i.e. `65.5999` or similar. 

Assuming my wild guess at the actual value is correct, you have `6559.9`, which is [stripped to `6599`](http://php.net/manual/en/language.operators.arithmetic.php) by the modulus operator, then divided by 10 for remainder 9.
Because 65.6 \* 100 is 6559.9999999999.

That's [floating points](https://stackoverflow.com/questions/56947/how-is-floating-point-stored-when-does-it-matter) for you.