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

relative_error.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("relative error", function (t) { t.test("equal values", function (t) { t.equal(ss.relativeError(14.5, 14.5), 0.0); t.end(); });
t.test("negative values", function (t) { t.equal(ss.relativeError(-4, -5), 0.2); t.end(); });
t.test("correct handling of zero", function (t) { t.equal(ss.relativeError(10101, 0), Infinity); t.end(); });
t.test("correct handling of double zero", function (t) { t.equal(ss.relativeError(0, 0), 0); t.end(); });
t.end();});
simplestatistic

Version Info

Tagged at
2 years ago