Minus corresponds to unary prefix minus in Python. The operation is evaluated using the same rules as subtract; the operation minus(a) is calculated as subtract('0', a) where the '0' has the same exponent as the operand. >>> ExtendedContext.minus(Decimal('1.3'))
(self, a)
| 4905 | return a.min_mag(b, context=self) |
| 4906 | |
| 4907 | def minus(self, a): |
| 4908 | """Minus corresponds to unary prefix minus in Python. |
| 4909 | |
| 4910 | The operation is evaluated using the same rules as subtract; the |
| 4911 | operation minus(a) is calculated as subtract('0', a) where the '0' |
| 4912 | has the same exponent as the operand. |
| 4913 | |
| 4914 | >>> ExtendedContext.minus(Decimal('1.3')) |
| 4915 | Decimal('-1.3') |
| 4916 | >>> ExtendedContext.minus(Decimal('-1.3')) |
| 4917 | Decimal('1.3') |
| 4918 | >>> ExtendedContext.minus(1) |
| 4919 | Decimal('-1') |
| 4920 | """ |
| 4921 | a = _convert_other(a, raiseit=True) |
| 4922 | return a.__neg__(context=self) |
| 4923 | |
| 4924 | def multiply(self, a, b): |
| 4925 | """multiply multiplies two operands. |