Lines Matching refs:random
6 import random
21 # Select a random odd n in [2**53/5**k,
24 n, e = random.randrange(lower, upper, 2), k
58 # bit pattern for a random finite positive (or +0.0) float
59 bits = random.randrange(2047*2**52)
94 digits = n + random.randrange(-3*u, 3*u)
104 # to boundary_tests, except that the random error doesn't scale
109 digits = base + random.randrange(-1000, 1000)
117 digits = random.randrange(dig10)
118 exponent = random.randrange(-400, 400)
127 # put together random short valid strings
131 s = random.choice(signs)
132 intpart_len = random.randrange(5)
133 s += ''.join(random.choice(digits) for _ in range(intpart_len))
134 if random.choice([True, False]):
136 fracpart_len = random.randrange(5)
137 s += ''.join(random.choice(digits)
141 if random.choice([True, False]):
142 s += random.choice(['e', 'E'])
143 s += random.choice(signs)
144 exponent_len = random.randrange(1, 4)
145 s += ''.join(random.choice(digits)
234 l = random.choice(TESTCASES[:6])
235 yield random.choice(l)
241 l1 = random.choice(TESTCASES)
242 l2 = random.choice(TESTCASES)
243 yield random.choice(l1), random.choice(l2)
247 l1 = random.choice(TESTCASES)
248 l2 = random.choice(TESTCASES)
249 l3 = random.choice(TESTCASES)
250 yield random.choice(l1), random.choice(l2), random.choice(l3)