(self)
| 850 | int(big_value) |
| 851 | |
| 852 | def test_pylong_roundtrip(self): |
| 853 | from random import randrange, getrandbits |
| 854 | bits = 5000 |
| 855 | while bits <= 1_000_000: |
| 856 | bits += randrange(-100, 101) # break bitlength patterns |
| 857 | hibit = 1 << (bits - 1) |
| 858 | n = hibit | getrandbits(bits - 1) |
| 859 | assert n.bit_length() == bits |
| 860 | sn = str(n) |
| 861 | self.assertNotStartsWith(sn, '0') |
| 862 | self.assertEqual(n, int(sn)) |
| 863 | bits <<= 1 |
| 864 | |
| 865 | @support.requires_resource('cpu') |
| 866 | @unittest.skipUnless(_decimal, "C _decimal module required") |
nothing calls this directly
no test coverage detected