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

Function GammaPlusLowIntegerInt

extern/ttmath/ttmath.h:2501–2525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2499 */
2500 template<class ValueType>
2501 ValueType GammaPlusLowIntegerInt(uint n, CGamma<ValueType> & cgamma)
2502 {
2503 TTMATH_ASSERT( n > 0 )
2504
2505 if( n - 1 < static_cast<uint>(cgamma.fact.size()) )
2506 return cgamma.fact[n - 1];
2507
2508 ValueType res;
2509 uint start = 2;
2510
2511 if( cgamma.fact.size() < 2 )
2512 {
2513 res.SetOne();
2514 }
2515 else
2516 {
2517 start = static_cast<uint>(cgamma.fact.size());
2518 res = cgamma.fact[start-1];
2519 }
2520
2521 for(uint i=start ; i<n ; ++i)
2522 res.MulInt(i);
2523
2524 return res;
2525 }
2526
2527
2528 /*!

Callers 1

GammaPlusLowIntegerFunction · 0.85

Calls 3

SetOneMethod · 0.80
sizeMethod · 0.45
MulIntMethod · 0.45

Tested by

no test coverage detected