Lines Matching refs:base
16 # Max number of base BASE digits to use in test cases. Doubling
117 # Get quasi-random long consisting of ndigits digits (in base BASE).
144 # Get random long consisting of ndigits random digits (relative to base
293 def slow_format(self, x, base):
299 x, r = divmod(x, base)
304 {2: '0b', 8: '0o', 10: '', 16: '0x'}[base] + \
308 for base, mapper in (2, bin), (8, oct), (10, str), (10, repr), (16, hex):
311 expected = self.slow_format(x, base)
349 # ... but it's just a normal digit if base >= 22
352 # tests with base 0
373 for base in invalid_bases:
374 self.assertRaises(ValueError, int, '42', base)
848 for base in bases:
849 for exp in range(base - 15, base + 15):