简体   繁体   中英

C# Equivalent to Python's Math.Comb function

Is there a C# equivalent function to Python's Math.Comb function?

I currently do not see anything in the System.Math class.

There is no equivalent in the .NET Framework.

It's easy to code it if you need just that one.

Otherwise I recommend you to use Math.NET Numerics library, look at this page for combinatory:

double Combinations(int n, int k)

Count the number of possible combinations without repetition. The order does not matter and each object can be chosen only once.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM