deno.land / x / simplestatistic@v7.7.1 / test / gamma.test.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* eslint no-shadow: 0 */
const test = require("tap").test;const ss = require("../");
test("gamma", function (t) { t.test("gamma for integer should return whole number", function (t) { t.equal(ss.gamma(5), 24); t.end(); }); t.test("gamma for positive real float should be correct", function (t) { t.ok(Math.abs(ss.gamma(11.54) - 13098426.039156161) < ss.epsilon); t.end(); }); t.test("gamma for negative real float should be correct", function (t) { t.ok(Math.abs(ss.gamma(-42.5) - -3.419793520724856e-52) < ss.epsilon); t.end(); }); t.test("gamma for negative integer should return NaN", function (t) { t.ok(isNaN(ss.gamma(-2))); t.end(); }); t.test("gamma for zero should return NaN", function (t) { t.ok(isNaN(ss.gamma(0))); t.end(); });
t.end();});
simplestatistic

Version Info

Tagged at
2 years ago