MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / permutations

Function permutations

libraries/statHelpers/statHelpers.cpp:17–25  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////// PERMUTATIONS

Source from the content-addressed store, hash-verified

15// PERMUTATIONS
16//
17uint32_t permutations(uint8_t n, uint8_t k)
18{
19 uint32_t rv = 1;
20 for (uint8_t i = n; i > (n - k); i--)
21 {
22 rv *= i;
23 }
24 return rv;
25}
26
27
28uint64_t permutations64(uint8_t n, uint8_t k)

Callers 1

unittestFunction · 0.85

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.68