Casting with int instead of intval

Using `(int)` instead of `intval()` is much faster.
See benchmark : https://gist.github.com/lucasmichot/89a18524e10e2af42de3/revisions

This PR also:
* skip the use of `floor()`
* use of `ceil()` instead of a division and addition
* remove unnecessary brackets