MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / factorial

Function factorial

source/MRMesh/MRFreeFormDeformer.cpp:45–53  ·  view source on GitHub ↗

simple factorial func

Source from the content-addressed store, hash-verified

43
44// simple factorial func
45int factorial( int n )
46{
47 if ( n == 0 || n == 1 )
48 return 1;
49 int res = n;
50 for ( int i = n - 1; i > 1; --i )
51 res *= i;
52 return res;
53}
54
55// n!
56// C(n,k) = --------

Callers 1

combinationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected