def percentile(N, P):
    """
    Find the percentile of a list of values
    @parameter N - A list of values.  N must be sorted.
    @parameter P - A float value from 0.0 to 1.0
    @return - The percentile of the values.
    """
    if len(N)==0:
        return 0.0
    n = int(round(P * len(N) + 0.5))
    return N[n-1]