Home
last modified time | relevance | path

Searched refs:getrandbits (Results 1 – 15 of 15) sorted by relevance

/third_party/python/Lib/test/
Dtest_random.py357 self.assertTrue(0 <= self.gen.getrandbits(k) < 2**k)
358 self.assertEqual(self.gen.getrandbits(0), 0)
361 getbits = self.gen.getrandbits
374 self.assertRaises(TypeError, self.gen.getrandbits)
375 self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
376 self.assertRaises(ValueError, self.gen.getrandbits, -1)
377 self.assertRaises(TypeError, self.gen.getrandbits, 10.1)
675 bits100 = self.gen.getrandbits(100)
677 self.assertEqual(self.gen.getrandbits(100), bits100)
788 self.assertEqual(self.gen.getrandbits(100),
[all …]
D_test_multiprocessing.py4377 d[random.getrandbits(5)] = {Foo() for i in range(10)}
/third_party/python/Lib/
Drandom.py244 getrandbits = self.getrandbits
246 r = getrandbits(k) # 0 <= r < 2**k
248 r = getrandbits(k)
287 return self.getrandbits(n * 8).to_bytes(n, 'little')
826 def getrandbits(self, k): member in SystemRandom
879 getrandbits = _inst.getrandbits variable
Dsecrets.py23 randbits = _sysrand.getrandbits
Duuid.py612 return random.getrandbits(48) | (1 << 40)
693 clock_seq = random.getrandbits(14) # instead of stable storage
/third_party/python/Doc/library/
Drandom.rst39 Optionally, a new generator can supply a :meth:`~Random.getrandbits` method --- this
153 .. function:: getrandbits(k)
158 :meth:`getrandbits` enables :meth:`randrange` to handle arbitrarily large
585 mantissa = 0x10_0000_0000_0000 | self.getrandbits(52)
589 x = self.getrandbits(32)
/third_party/python/Lib/email/
Dutils.py186 randint = random.getrandbits(64)
/third_party/python/Misc/NEWS.d/
D3.7.0b4.rst208 consistently even when called from subclasses without a ``getrandbits()``
D3.6.6rc1.rst369 consistently even when called from subclasses without a ``getrandbits()``
D3.9.0b1.rst525 ``randbytes()`` now directly reuses ``getrandbits()``.
D3.9.0a6.rst468 Allow ``random.getrandbits(0)`` to succeed and to return 0.
D3.8.0a1.rst5173 only once at class/subclass instantiation time whether its ``getrandbits()``
5218 consistently even when called from subclasses without a ``getrandbits()``
/third_party/python/Doc/whatsnew/
D2.4.rst1246 * The :mod:`random` module has a new method called ``getrandbits(N)`` that
1248 method now uses :meth:`getrandbits` where appropriate, making generation of
D3.4.rst2040 * :func:`random.getrandbits` is 20%-40% faster for small integers (the most
/third_party/python/Misc/
DHISTORY5493 - Issue #16674: random.getrandbits() is now 20-40% faster for small integers.
20708 - random.Random has a new method, getrandbits(k), which returns an int