New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change comparsion for checking if number is negative to include 128 #15105
Conversation
Reason: The last byte in Little Endian representation of negative integers start at 128 (Ox80) till 255 (OxFF). The comparison before the fix didn't check for 128 which made is_negative variable as false.
++ @HKalbasi I created a PR for the fix. |
Can you also add some tests in |
Should I create a new test function or should I add the tests in |
Both would work, do it as you see fit. |
I added the tests and it passed with fix. I temporarily reverted the see if the test fails or not but the test passed. Should I change my tests to test the |
I think using For checking the |
I wrote more tests in P.S: Should I amend the two test commits into one, so they are organized and reduce the commit clutter? |
Yes please, and then we can merge this I think. |
Added a test near positive extermes and two test near negative extermes as well one for 0. Added a test using the `as` cast and one with comparison with 0.
Thanks! |
☀️ Test successful - checks-actions |
The last byte in Little-Endian representation of negative integers start at 128 (Ox80) till 255 (OxFF). The comparison before the fix didn't check for 128 which made is_negative variable as false.
Potentially fixes #15096