mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +00:00
LibJS: Improve correctness of rounding and bitwise operations
Patch from Anonymous
This commit is contained in:
parent
6622ad8895
commit
16a0e7a66d
Notes:
sideshowbarker
2024-07-18 22:35:07 +09:00
Author: https://github.com/awesomekling
Commit: 16a0e7a66d
9 changed files with 106 additions and 19 deletions
|
@ -40,6 +40,11 @@ test("basic numeric shifting", () => {
|
|||
expect(5 << 3).toBe(40);
|
||||
expect(5 << 4).toBe(80);
|
||||
expect(5 << 5).toBe(160);
|
||||
|
||||
expect(0xffffffff << 0).toBe(-1);
|
||||
expect(0xffffffff << 16).toBe(-65536);
|
||||
expect(0xffff0000 << 16).toBe(0);
|
||||
expect(0xffff0000 << 15).toBe(-2147483648);
|
||||
});
|
||||
|
||||
test("shifting with non-numeric values", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue