jbrukh / bayesian

Naive Bayesian Classification for Golang.
Other
799 stars 128 forks source link

Panic if underflow is detected in `SafeProbScores` #7

Closed yml closed 8 years ago

yml commented 8 years ago

SafeProbScores ... If an underflow is detected, this method panics

Source

I am getting a bit confused by the comment in the method above according to the doc this method is suppose to panic but the code instead returns an error.

Am I missing something ?

jbrukh commented 8 years ago

Your confusion is not unwarranted -- the comment is incorrect. In the case of underflow, the method will return an error. The comment still applies if you replace "returns an error" for "panics".

Will fix.

yml commented 8 years ago

Waouuu that was fast :-) Thank you very much for releasing this code and accepting PR.

jbrukh commented 8 years ago

My pleasure. Thanks for contributing.