Returns the smallest representable number larger than a. >>> c = ExtendedContext.copy() >>> c.Emin = -999 >>> c.Emax = 999 >>> ExtendedContext.next_plus(Decimal('1')) Decimal('1.00000001') >>> c.next_plus(Decimal('-1E-1007')) Decimal('
(self, a)
| 5007 | return a.next_minus(context=self) |
| 5008 | |
| 5009 | def next_plus(self, a): |
| 5010 | """Returns the smallest representable number larger than a. |
| 5011 | |
| 5012 | >>> c = ExtendedContext.copy() |
| 5013 | >>> c.Emin = -999 |
| 5014 | >>> c.Emax = 999 |
| 5015 | >>> ExtendedContext.next_plus(Decimal('1')) |
| 5016 | Decimal('1.00000001') |
| 5017 | >>> c.next_plus(Decimal('-1E-1007')) |
| 5018 | Decimal('-0E-1007') |
| 5019 | >>> ExtendedContext.next_plus(Decimal('-1.00000003')) |
| 5020 | Decimal('-1.00000002') |
| 5021 | >>> c.next_plus(Decimal('-Infinity')) |
| 5022 | Decimal('-9.99999999E+999') |
| 5023 | >>> c.next_plus(1) |
| 5024 | Decimal('1.00000001') |
| 5025 | """ |
| 5026 | a = _convert_other(a, raiseit=True) |
| 5027 | return a.next_plus(context=self) |
| 5028 | |
| 5029 | def next_toward(self, a, b): |
| 5030 | """Returns the number closest to a, in direction towards b. |
nothing calls this directly
no test coverage detected