2.0 KiB
2.0 KiB
id, challengeType, videoUrl, title
id | challengeType | videoUrl | title |
---|---|---|---|
5a23c84252665b21eecc7e76 | 5 | 伽玛功能 |
Description
$ \ Gamma(x)= \ displaystyle \ int_0 ^ \ infty t ^ {x-1} e ^ { - t} dt $
Instructions
Tests
tests:
- text: <code>gamma</code>应该是一个功能。
testString: assert(typeof gamma=='function')
- text: '<code>gamma("+tests[0]+")</code>应该返回一个数字。'
testString: assert(typeof gamma(.1)=='number')
- text: '<code>gamma("+tests[0]+")</code>应该返回<code>"+results[0]+"</code> 。'
testString: assert.equal(round(gamma(.1)), round(9.513507698668736))
- text: '<code>gamma("+tests[1]+")</code>应该返回<code>"+results[1]+"</code> 。'
testString: assert.equal(round(gamma(.2)), round(4.590843711998803))
- text: '<code>gamma("+tests[2]+")</code>应该返回<code>"+results[2]+"</code> 。'
testString: assert.equal(round(gamma(.3)), round(2.9915689876875904))
- text: '<code>gamma("+tests[3]+")</code>应该返回<code>"+results[3]+"</code> 。'
testString: assert.equal(round(gamma(.4)), round(2.218159543757687))
- text: '<code>gamma("+tests[4]+")</code>应返回<code>"+results[4]+"</code> 。'
testString: assert.equal(round(gamma(.5)), round(1.7724538509055159))
Challenge Seed
function gamma (x) {
// Good luck!
}
After Test
console.info('after the test');
Solution
// solution required
/section>