stirling is an approximation function for factorial(n). it is slower but constant in time. float => 26! double => 143!
| 182 | // float => 26! |
| 183 | // double => 143! |
| 184 | double stirling(uint8_t n) |
| 185 | { |
| 186 | double v = exp(-n) * pow(n, n) * sqrt(TWO_PI * n); |
| 187 | return v; |
| 188 | } |
| 189 | |
| 190 | |
| 191 | // SEMIFACTORIAL |