Returns a copy of the operand with the sign inverted. >>> ExtendedContext.copy_negate(Decimal('101.5')) Decimal('-101.5') >>> ExtendedContext.copy_negate(Decimal('-101.5')) Decimal('101.5') >>> ExtendedContext.copy_negate(1) Decimal('-1')
(self, a)
| 4300 | return Decimal(a) |
| 4301 | |
| 4302 | def copy_negate(self, a): |
| 4303 | """Returns a copy of the operand with the sign inverted. |
| 4304 | |
| 4305 | >>> ExtendedContext.copy_negate(Decimal('101.5')) |
| 4306 | Decimal('-101.5') |
| 4307 | >>> ExtendedContext.copy_negate(Decimal('-101.5')) |
| 4308 | Decimal('101.5') |
| 4309 | >>> ExtendedContext.copy_negate(1) |
| 4310 | Decimal('-1') |
| 4311 | """ |
| 4312 | a = _convert_other(a, raiseit=True) |
| 4313 | return a.copy_negate() |
| 4314 | |
| 4315 | def copy_sign(self, a, b): |
| 4316 | """Copies the second operand's sign to the first one. |