MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_quantize

Method test_quantize

Lib/test/test_decimal.py:4688–4699  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4686 self.assertTrue(c.flags[Overflow])
4687
4688 def test_quantize(self):
4689 Decimal = self.decimal.Decimal
4690 localcontext = self.decimal.localcontext
4691 InvalidOperation = self.decimal.InvalidOperation
4692
4693 with localcontext() as c:
4694 c.prec = 1
4695 c.Emax = 1
4696 c.Emin = -1
4697 c.traps[InvalidOperation] = False
4698 x = Decimal(99).quantize(Decimal("1e1"))
4699 self.assertTrue(x.is_nan())
4700
4701 def test_radix(self):
4702 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

localcontextFunction · 0.85
DecimalClass · 0.85
assertTrueMethod · 0.80
quantizeMethod · 0.45
is_nanMethod · 0.45

Tested by

no test coverage detected