Skip to content

Instantly share code, notes, and snippets.

@justinclayton
Created June 13, 2018 17:32
Show Gist options
  • Save justinclayton/23c309f7a296e8c8ce5497d0114079a7 to your computer and use it in GitHub Desktop.
Save justinclayton/23c309f7a296e8c8ce5497d0114079a7 to your computer and use it in GitHub Desktop.
# nearest-rank percentile, assumes sorted array
function ceil(valor)
{
return (valor == int(valor)) ? valor : int(valor)+1
}
function p(k, values) {
return values[ceil((k / 100) * length(values))]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment