-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move plain number tests from
node-tests
to unit-tests
, rem…
…ove redundant tests (see #3011)
- Loading branch information
Showing
4 changed files
with
36 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,7 +217,6 @@ Evan Miller <[email protected]> | |
Timur <[email protected]> | ||
Ari Markowitz <[email protected]> | ||
Jay Wang <[email protected]> | ||
David Contreras <[email protected] | ||
Jaeu Jeong <[email protected]> | ||
cyavictor88 <[email protected]> | ||
David Contreras <[email protected]> | ||
|
@@ -230,9 +229,9 @@ Michael Greminger <[email protected]> | |
Kiku <[email protected]> | ||
MaybePixem <[email protected]> | ||
Aly Khaled <[email protected]> | ||
Praise Nnamonu <[email protected]> | ||
BuildTools <[email protected]> | ||
Anik Patel <[email protected]> | ||
Vrushaket Chaudhari <[email protected]> | ||
Praise Nnamonu <[email protected]> | ||
|
||
# Generated by tools/update-authors.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import assert from 'assert' | ||
import approx from '../../../../tools/approx.js' | ||
import { modNumber } from '../../../../src/plain/number/arithmetic.js' | ||
|
||
describe('mod', function () { | ||
it('should calculate the modulus of two numbers', function () { | ||
assert.strictEqual(modNumber(1, 1), 0) | ||
assert.strictEqual(modNumber(0, 1), 0) | ||
assert.strictEqual(modNumber(1, 0), 1) | ||
assert.strictEqual(modNumber(0, 0), 0) | ||
assert.strictEqual(modNumber(7, 0), 7) | ||
|
||
approx.equal(modNumber(7, 2), 1) | ||
approx.equal(modNumber(9, 3), 0) | ||
approx.equal(modNumber(10, 4), 2) | ||
approx.equal(modNumber(-10, 4), 2) | ||
approx.equal(modNumber(8.2, 3), 2.2) | ||
approx.equal(modNumber(4, 1.5), 1) | ||
approx.equal(modNumber(0, 3), 0) | ||
approx.equal(modNumber(-10, 4), 2) | ||
approx.equal(modNumber(-5, 3), 1) | ||
}) | ||
|
||
it('should calculate mod for negative divisor', function () { | ||
assert.strictEqual(modNumber(10, -4), -2) | ||
}) | ||
}) |