Lines Matching full:prec
277 __slots__ = ['prec']
280 result.prec = kwds.get('prec', 12)
283 prec = self.prec
285 return "%.*g" % (prec, self.real)
287 return "%.*gj" % (prec, self.imag)
288 return "(%.*g+%.*gj)" % (prec, self.real, prec, self.imag)
291 a = Number(3.14, prec=6)
293 self.assertEqual(a.prec, 6)
295 a = Number(a, prec=2)
297 self.assertEqual(a.prec, 2)
301 self.assertEqual(a.prec, 12)
2561 __slots__ = ['prec']
2562 def __init__(self, value=0.0, prec=12):
2563 self.prec = int(prec)
2565 return "%.*g" % (self.prec, self)