diff options
author | xuri <xuri.me@gmail.com> | 2021-11-09 00:10:09 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-11-09 00:10:09 +0800 |
commit | a68bc34b0c60143bc649415fd7ff7acca70d6bdf (patch) | |
tree | e749f940f7d3a9995020f2c0e53fe56e22e8e3bf /lib.go | |
parent | 8f82d8b02909ca96a9c7f7c3431d1ae990c90191 (diff) |
ref #65: new formula functions PERCENTRANK.EXC, PERCENTRANK.INC and PERCENTRANK
Diffstat (limited to 'lib.go')
-rw-r--r-- | lib.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -381,6 +381,17 @@ func inStrSlice(a []string, x string) int { return -1 } +// inFloat64Slice provides a method to check if an element is present in an +// float64 array, and return the index of its location, otherwise return -1. +func inFloat64Slice(a []float64, x float64) int { + for idx, n := range a { + if x == n { + return idx + } + } + return -1 +} + // boolPtr returns a pointer to a bool with the given value. func boolPtr(b bool) *bool { return &b } |