Lines Matching defs:random
6 import random
117 # Get quasi-random long consisting of ndigits digits (in base BASE).
120 # more likely than random bits to provoke digit-boundary errors.
121 # The sign of the number is also random.
129 r = int(random.random() * (SHIFT * 2)) | 1 # force 1 bits to start
138 r = int(random.random() * (SHIFT * 2))
140 if random.random() < 0.5:
144 # Get random long consisting of ndigits random digits (relative to base
145 # BASE). The sign bit is also random.
150 answer = (answer << SHIFT) | random.randint(0, MASK)
151 if random.random() < 0.5:
893 # largeish random divisions: a/b where |a| <= |b| <=
899 a = random.randrange(1, M)
900 b = random.randrange(a, 2*a+1)
906 # and some (genuinely) random tests
908 a_bits = random.randrange(1000)
909 b_bits = random.randrange(1, 1000)
910 x = random.randrange(2**a_bits)
911 y = random.randrange(1, 2**b_bits)
1191 x = random.randrange(-10000, 10000)
1200 x = random.randrange(-10000, 10000)