Uses cleaner integer division instead of casting.