Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Add math helpers, tests and checks | 1 | const assert = require("node:assert"); |
| 2 | const math = require("./math"); | |
| Merge main into mod branch, keeping subtract and mod | 3 | assert.strictEqual(math.subtract(5, 3), 2); |
| Add math helpers, tests and checks | 4 | |
| 5 | assert.strictEqual(math.add(2, 3), 5); | |
| Merge #3: Add multiply to math.js | 6 | assert.strictEqual(math.multiply(4, 5), 20); |
| Merge main into mod branch, keeping divide and mod | 7 | assert.strictEqual(math.divide(10, 4), 2.5); |
| 8 | assert.throws(() => math.divide(1, 0), RangeError); | |
| Add mod function to math.js | 9 | assert.strictEqual(math.mod(7, 3), 1); |
| 10 | assert.strictEqual(math.mod(-1, 3), 2); | |
| 11 | assert.strictEqual(math.mod(6, 3), 0); | |
| 12 | assert.strictEqual(math.mod(-1, -3), 2); | |
| 13 | assert.throws(() => math.mod(1, 0), RangeError); | |
| Catch up with main | 14 | assert.strictEqual(math.power(2, 10), 1024); |
| 15 | assert.strictEqual(math.power(5, 0), 1); | |
| 16 | assert.throws(() => math.power(2, -1), RangeError); | |
| Merge main into mod branch, keeping subtract and mod | 17 | assert.strictEqual(math.mean([1, 2, 3]), 2); |
| Catch up with main | 18 | assert.strictEqual(math.mean([1, 2, 3, 4]), 2.5); |
| Merge main into mod branch, keeping subtract and mod | 19 | assert.strictEqual(math.median([1, 2, 3]), 2); |
| Catch up with main | 20 | assert.strictEqual(math.median([3, 1, 2]), 2); |
| 21 | assert.strictEqual(math.median([4, 1, 3, 2]), 2.5); | |
| Merge main into mod branch, keeping subtract and mod | 22 | assert.strictEqual(math.standard_deviation([1, 2, 3]), Math.sqrt(2 / 3)); |
| Catch up with main | 23 | assert.strictEqual(math.standard_deviation([2, 4, 4, 4, 5, 5, 7, 9]), 2); |
| 24 | for (const fn of [math.mean, math.median, math.standard_deviation]) { | |
| 25 | assert.throws(() => fn([]), TypeError); | |
| 26 | } | |
| Add math helpers, tests and checks | 27 | console.log("all tests passed"); |
This file's history is long; its oldest lines are credited to the oldest commit read.