Skip to content
⌘K
Explore
Download
Docs
Sign in
Sign up
flagon-io
/
automation-lab
public
Star
0
Overview
Code
Issues
1
Pull requests
Workflows
Deployments
Insights
Files
Commits
Branches
Tags
Releases
Compare
Compare changes
Choose two branches to see what one has that the other does not, then open a pull request for it.
base
compare
Compare
Open a pull request
1 commit
Merge #5: Add subtract to math.js
g1t
bot
bea433b
4d ago
2
files
+7
−1
0/2 viewed
Files
Collapse all
Unified
Split
math.js
+6
−1
View
Blame
Viewed
9
9
return a * b;
10
10
}
11
11
12
+
/** Returns a minus b. */
13
+
function subtract(a, b) {
14
+
return a - b;
15
+
}
16
+
12
17
/** Returns base raised to the whole-number exponent; throws a RangeError if exponent is negative. */
13
18
function power(base, exponent) {
14
19
if (exponent < 0) {
⋯
46
51
return Math.sqrt(variance);
47
52
}
48
53
49
−
module.exports = { add, multiply, power, mean, median, standard_deviation };
54
+
module.exports = { add, multiply, subtract, power, mean, median, standard_deviation };
test.js
+1
−0
View
Blame
Viewed
1
1
const assert = require("node:assert");
2
2
const math = require("./math");
3
+
assert.strictEqual(math.subtract(5, 3), 2);
3
4
4
5
assert.strictEqual(math.add(2, 3), 5);
5
6
assert.strictEqual(math.multiply(4, 5), 20);