def padNextPower2(size: int) ->int:
    """Calculate the amount of padding to next power of 2
    
    Parameters
    ----------
    size : float
        Size of array to be padded   

    Returns
    -------
    padSize : int
        Amout of extra padding required to increase to next power of 2
    """
    import math
    next2Power = math.ceil(math.log(size, 2))
    next2Size = math.pow(2, int(next2Power))
    return int(next2Size) - size
