mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:48:12 +00:00
LibJS: Implement the Number::remainder AO using fmod
The ECMA verbiage for modulus is the mathematical definition implemented by fmod, so let's just use that rather than trying to reimplement all the edge cases.
This commit is contained in:
parent
602190f66f
commit
1e0facb7ee
3 changed files with 9 additions and 30 deletions
|
@ -23,6 +23,7 @@ test("basic functionality", () => {
|
|||
expect(1 % -0).toBeNaN();
|
||||
expect(0 % 5).toBe(0);
|
||||
expect(-0 % 5).toBe(-0);
|
||||
expect((-1) % -1).toBe(-0);
|
||||
|
||||
// test262 examples
|
||||
expect(1 % null).toBeNaN();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue