--- title: Gamma function id: 5a23c84252665b21eecc7e76 challengeType: 5 videoUrl: '' localeTitle: 伽玛功能 --- ## Description
实现一个算法(或更多)来计算Gamma ($ \ 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') - text: 'gamma("+tests[0]+")应该返回一个数字。' testString: assert(typeof gamma(.1)=='number') - text: 'gamma("+tests[0]+")应该返回"+results[0]+" 。' testString: assert.equal(round(gamma(.1)), round(9.513507698668736)) - text: 'gamma("+tests[1]+")应该返回"+results[1]+" 。' testString: assert.equal(round(gamma(.2)), round(4.590843711998803)) - text: 'gamma("+tests[2]+")应该返回"+results[2]+" 。' testString: assert.equal(round(gamma(.3)), round(2.9915689876875904)) - text: 'gamma("+tests[3]+")应该返回"+results[3]+" 。' testString: assert.equal(round(gamma(.4)), round(2.218159543757687)) - text: 'gamma("+tests[4]+")应返回"+results[4]+" 。' testString: assert.equal(round(gamma(.5)), round(1.7724538509055159)) ```
## Challenge Seed
```js function gamma (x) { // Good luck! } ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```