mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:12:44 +00:00 
			
		
		
		
	 58c6a156bf
			
		
	
	
		58c6a156bf
		
	
	
	
	
		
			
			Currently, we get the following results
    -1 - -2 = -1
    -2 - -1 =  1
Correct would be:
    -1 - -2 =  1
    -2 - -1 = -1
This was already attempted to be fixed in 7ed8970, but that change was
incorrect. This directly translates to LibJS BigInts having the same
incorrect behavior - it even was tested.
		
	
			
		
			
				
	
	
		
			8 lines
		
	
	
	
		
			220 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			8 lines
		
	
	
	
		
			220 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| describe("minus behavior", () => {
 | |
|     test("the basics", () => {
 | |
|         expect(3n - 4n).toBe(-1n);
 | |
|         expect(3n - -4n).toBe(7n);
 | |
|         expect(-3n - -4n).toBe(1n);
 | |
|         expect(-3n - 4n).toBe(-7n);
 | |
|     });
 | |
| });
 |