Return (a // b, a % b). >>> ExtendedContext.divmod(Decimal(8), Decimal(3)) (Decimal('2'), Decimal('2')) >>> ExtendedContext.divmod(Decimal(8), Decimal(4)) (Decimal('2'), Decimal('0')) >>> ExtendedContext.divmod(8, 4) (Decimal('2'), Decimal('0'))
(self, a, b)
| 4397 | return r |
| 4398 | |
| 4399 | def divmod(self, a, b): |
| 4400 | """Return (a // b, a % b). |
| 4401 | |
| 4402 | >>> ExtendedContext.divmod(Decimal(8), Decimal(3)) |
| 4403 | (Decimal('2'), Decimal('2')) |
| 4404 | >>> ExtendedContext.divmod(Decimal(8), Decimal(4)) |
| 4405 | (Decimal('2'), Decimal('0')) |
| 4406 | >>> ExtendedContext.divmod(8, 4) |
| 4407 | (Decimal('2'), Decimal('0')) |
| 4408 | >>> ExtendedContext.divmod(Decimal(8), 4) |
| 4409 | (Decimal('2'), Decimal('0')) |
| 4410 | >>> ExtendedContext.divmod(8, Decimal(4)) |
| 4411 | (Decimal('2'), Decimal('0')) |
| 4412 | """ |
| 4413 | a = _convert_other(a, raiseit=True) |
| 4414 | r = a.__divmod__(b, context=self) |
| 4415 | if r is NotImplemented: |
| 4416 | raise TypeError("Unable to convert %s to Decimal" % b) |
| 4417 | else: |
| 4418 | return r |
| 4419 | |
| 4420 | def exp(self, a): |
| 4421 | """Returns e ** a. |