Plus corresponds to unary prefix plus in Python. The operation is evaluated using the same rules as add; the operation plus(a) is calculated as add('0', a) where the '0' has the same exponent as the operand. >>> ExtendedContext.plus(Decimal('1.3')) Decimal('
(self, a)
| 5103 | return a.number_class(context=self) |
| 5104 | |
| 5105 | def plus(self, a): |
| 5106 | """Plus corresponds to unary prefix plus in Python. |
| 5107 | |
| 5108 | The operation is evaluated using the same rules as add; the |
| 5109 | operation plus(a) is calculated as add('0', a) where the '0' |
| 5110 | has the same exponent as the operand. |
| 5111 | |
| 5112 | >>> ExtendedContext.plus(Decimal('1.3')) |
| 5113 | Decimal('1.3') |
| 5114 | >>> ExtendedContext.plus(Decimal('-1.3')) |
| 5115 | Decimal('-1.3') |
| 5116 | >>> ExtendedContext.plus(-1) |
| 5117 | Decimal('-1') |
| 5118 | """ |
| 5119 | a = _convert_other(a, raiseit=True) |
| 5120 | return a.__pos__(context=self) |
| 5121 | |
| 5122 | def power(self, a, b, modulo=None): |
| 5123 | """Raises a to the power of b, to modulo if given. |