jasondavies / science.js

Scientific and statistical computing in JavaScript.
http://www.jasondavies.com/
Other
886 stars 93 forks source link

Mode of single-element arrays is null #7

Closed tmcw closed 11 years ago

tmcw commented 11 years ago

This seems incorrect:

assert.equal(science.stats.mode([1]), 1);

Fails, since it's null. If this isn't desired behavior, I can probably pull together a patch to fix.

jasondavies commented 11 years ago

Thanks for the bug report! I'd like to change the API to return multiple modes in a future release if there is no unique mode.