Skip to content

Instantly share code, notes, and snippets.

@markusbuchholz
Created August 28, 2021 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markusbuchholz/93403be2c57e7e45236e6ce7d348112a to your computer and use it in GitHub Desktop.
Save markusbuchholz/93403be2c57e7e45236e6ce7d348112a to your computer and use it in GitHub Desktop.
double computeBinominal(int n, int k)
{
double value = 1.0;
for (int i = 1; i <= k; i++)
{
value = value * ((n + 1 - i) / i);
}
if (n == k){
value = 1;
}
return value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment