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 \* 100 is 6559.9999999999.

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

```
<?php

echo (65.7 * 100 == 6570) ? "Equal" : "Not equal";  // Equal
echo (65.6 * 100 == 6560) ? "Equal" : "Not equal";  // NOT EQUAL !!
echo (65.5 * 100 == 6550) ? "Equal" : "Not equal";  // Equal

?>

```

65.6 \* 100 is **NOT** 6560. The [big red warning box here](http://php.net/manual/en/language.types.float.php) explains why.