Type casting

Can you explain why this code outputs 7 and not 8? I understand there is type casting taking place but I cannot figure why it gives 7, thanks

echo (int) ( (0.1+0.7) * 10 );

See here: http://php.net/manual/en/language.types.float.php

interesting, thanks

…but isn’t the manual where you got the above example from?

no it was in a test, i guess they took it from the manual :slight_smile: