def integer_cube_root_binary_search(n):
    """Returns the largest number n such that n ** 3 <= num"""
    high = (n // 2) + 1
    low = 0
    while low < high:
        mid = (low + high) // 2
        if mid ** 3 < n:
            # mid works, but higher option might work too
            low = mid + 1
        else:
            # don't rule out this option, because mid ** 3 could be equal to n
            high = mid
    return low