You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
functionmultinomial(k...)
s =0
result =1@inboundsfor i in k
s += i
bi =binomial(s, i)
result, f = Base.mul_with_overflow(result, bi)
f &&error("overflow: $(result)")
end
result
end
multinomial
internally usesbinomial
. While the latter check for overflow, the whole computation ofmultinomial
is not checked for overflow, leading to :multinomial(150, 150, 150, 150)
--> error overflow reported bybinomial
multinomial(15, 15, 15, 15)
--> no error reportedSee also this thread on Discourse.
The text was updated successfully, but these errors were encountered: