Revert "Use (int), ceil() and remove useless brackets"

This reverts commit 692cd4e9642e55659e3f409fcea0a5f6d129be80.
Revert "Revert "Use (int), ceil() and remove useless brackets""

This reverts commit 63e33c141e75ad0bf166133a8d3b17ccfd19606b.