--- title: Gamma function id: 5a23c84252665b21eecc7e76 challengeType: 5 videoUrl: '' localeTitle: Гамма-функция --- ## Description
Внедрите один алгоритм (или более) для вычисления функции Gamma ($ \ Gamma $) (только в реальном поле). Гамма-функция может быть определена как:
$ \ Gamma (x) = \ displaystyle \ int_0 ^ \ infty t ^ {x-1} e ^ {- t} dt $
## Instructions
## Tests
```yml tests: - text: gamma должна быть функцией. testString: 'assert(typeof gamma=="function","gamma should be a function.")' - text: 'gamma("+tests[0]+") должно возвращать число.' testString: 'assert(typeof gamma(tests[0])=="number","gamma("+tests[0]+") should return a number.")' - text: 'gamma("+tests[0]+") должен возвращать "+results[0]+" .' testString: 'assert.equal(gamma(tests[0]),results[0],"gamma("+tests[0]+") should return "+results[0]+".")' - text: 'gamma("+tests[1]+") должны возвращать "+results[1]+" .' testString: 'assert.equal(gamma(tests[1]),results[1],"gamma("+tests[1]+") should return "+results[1]+".")' - text: 'gamma("+tests[2]+") должен возвращать "+results[2]+" .' testString: 'assert.equal(gamma(tests[2]),results[2],"gamma("+tests[2]+") should return "+results[2]+".")' - text: 'gamma("+tests[3]+") должны возвращать "+results[3]+" .' testString: 'assert.equal(gamma(tests[3]),results[3],"gamma("+tests[3]+") should return "+results[3]+".")' - text: 'gamma("+tests[4]+") должны возвращать "+results[4]+" .' testString: 'assert.equal(gamma(tests[4]),results[4],"gamma("+tests[4]+") should return "+results[4]+".")' ```
## Challenge Seed
```js function gamma (x) { // Good luck! } ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```