MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / SetFactorialSequence

Function SetFactorialSequence

extern/ttmath/ttmath.h:2199–2218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2197 */
2198 template<class ValueType>
2199 void SetFactorialSequence(std::vector<ValueType> & fact, uint more = 20)
2200 {
2201 if( more == 0 )
2202 more = 1;
2203
2204 uint start = static_cast<uint>(fact.size());
2205 fact.resize(fact.size() + more);
2206
2207 if( start == 0 )
2208 {
2209 fact[0] = 1;
2210 ++start;
2211 }
2212
2213 for(uint i=start ; i<fact.size() ; ++i)
2214 {
2215 fact[i] = fact[i-1];
2216 fact[i].MulInt(i);
2217 }
2218 }
2219
2220
2221 /*!

Callers 1

SetBernoulliNumbersFunction · 0.85

Calls 3

sizeMethod · 0.45
resizeMethod · 0.45
MulIntMethod · 0.45

Tested by

no test coverage detected