Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21238

Combinations routine

$
0
0
Hi,

I want to make a routine for VB6 to calculate:

n!/(K!*(N-K)!)

where N! is the factorial of N, K!, the factorial of K, etc.
The factorial function is easy to make; the problem is that it turns easily overflow...

Can someone help me out? I can eliminate in N! the firt K elements, for instance, in the multiplication...

Kind regards,

JKepler

Viewing all articles
Browse latest Browse all 21238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>