fredrick / gauss

JavaScript statistics, analytics, and data library - Node.js and web browser ready
https://npmjs.org/package/gauss
Other
433 stars 29 forks source link

Make percentiles work for all percentiles #1

Closed bluesmoon closed 13 years ago

bluesmoon commented 13 years ago

The current implementation of the percentile method will return undefined for anything that does not result in a whole number when multiplied by the length.

This patch makes sure that percent * length is always a whole number greater than 0.

fredrick commented 13 years ago

Thanks for the contribution, at first glace these look good to me, I'll look into it more today and get it merged in.

bluesmoon commented 13 years ago

There may be an off by one bug in my code for some cases. I'm investigating and will add a patch today if needed.

hello world