Returns the largest representable number smaller than a. >>> c = ExtendedContext.copy() >>> c.Emin = -999 >>> c.Emax = 999 >>> ExtendedContext.next_minus(Decimal('1')) Decimal('0.999999999') >>> c.next_minus(Decimal('1E-1007')) Decimal('0E-100
(self, a)
| 4951 | return r |
| 4952 | |
| 4953 | def next_minus(self, a): |
| 4954 | """Returns the largest representable number smaller than a. |
| 4955 | |
| 4956 | >>> c = ExtendedContext.copy() |
| 4957 | >>> c.Emin = -999 |
| 4958 | >>> c.Emax = 999 |
| 4959 | >>> ExtendedContext.next_minus(Decimal('1')) |
| 4960 | Decimal('0.999999999') |
| 4961 | >>> c.next_minus(Decimal('1E-1007')) |
| 4962 | Decimal('0E-1007') |
| 4963 | >>> ExtendedContext.next_minus(Decimal('-1.00000003')) |
| 4964 | Decimal('-1.00000004') |
| 4965 | >>> c.next_minus(Decimal('Infinity')) |
| 4966 | Decimal('9.99999999E+999') |
| 4967 | >>> c.next_minus(1) |
| 4968 | Decimal('0.999999999') |
| 4969 | """ |
| 4970 | a = _convert_other(a, raiseit=True) |
| 4971 | return a.next_minus(context=self) |
| 4972 | |
| 4973 | def next_plus(self, a): |
| 4974 | """Returns the smallest representable number larger than a. |