Combinatorics.jl icon indicating copy to clipboard operation
Combinatorics.jl copied to clipboard

multinomial() may lead to hidden overflow

Open sylvaticus opened this issue 5 years ago • 0 comments

multinomial internally uses binomial. While the latter check for overflow, the whole computation of multinomial is not checked for overflow, leading to :

multinomial(150, 150, 150, 150) --> error overflow reported by binomial multinomial(15, 15, 15, 15) --> no error reported

See also this thread on Discourse.

sylvaticus avatar Sep 23 '20 14:09 sylvaticus