Made a separate function `intDiv` for integer division, that's more readable than `Math.floor` inside expression. The function performs `a / b` and then truncates the fractional part using the fastest method: binary `~~`