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

gammaln.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
/* eslint no-shadow: 0 */
const test = require("tap").test;const ss = require("../");
test("gammaln", function (t) { t.test("gammaln for positive real float should be correct", function (t) { t.equal(ss.gammaln(11.54), 16.388002631263966); t.end(); }); t.test("exp(gammaln(n)) for n should equal gamma(n)", function (t) { t.equal( Math.round(Math.exp(ss.gammaln(8.2))), Math.round(ss.gamma(8.2)) ); t.end(); }); t.test("gammaln for negative n should be Infinity", function (t) { t.equal(ss.gammaln(-42.5), Infinity); t.end(); }); t.test("gammaln for n === 0 should return NaN", function (t) { t.equal(ss.gammaln(0), Infinity); t.end(); });
t.end();});
simplestatistic

Version Info

Tagged at
2 years ago