GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — gh-119714: Add PyLong_GetNumBits() function by vstinner · Pull Request #119715 · python/cpython Conversation
|
| self.assertEqual(numbits(0), 0) | ||
| self.assertEqual(numbits(7), 3) | ||
| self.assertEqual(numbits(-37), 6) | ||
| self.assertEqual(numbits(684_643_661_981), 40) | ||
| self.assertEqual(numbits(2**123-1), 123) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
There are no tests for the two overflow cases.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I added a test, but it requires 1145324612.3 GiB of memory to run :-) On 32-bit systems, the test pass and only requires 273 MiB.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Erlend E. Aasland <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
|
PR rebased to fix merge conflicts with the main branch (with the new PyLong_GetSign() function). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The C API Working Group rejected this API: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.