Created
June 13, 2018 17:32
-
-
Save justinclayton/23c309f7a296e8c8ce5497d0114079a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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