MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / minus

Method minus

tools/python-3.11.9-amd64/Lib/_pydecimal.py:4940–4955  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

4938 return a.min_mag(b, context=self)
4939
4940 def minus(self, a):
4941 """Minus corresponds to unary prefix minus in Python.
4942
4943 The operation is evaluated using the same rules as subtract; the
4944 operation minus(a) is calculated as subtract('0', a) where the '0'
4945 has the same exponent as the operand.
4946
4947 >>> ExtendedContext.minus(Decimal('1.3'))
4948 Decimal('-1.3')
4949 >>> ExtendedContext.minus(Decimal('-1.3'))
4950 Decimal('1.3')
4951 >>> ExtendedContext.minus(1)
4952 Decimal('-1')
4953 """
4954 a = _convert_other(a, raiseit=True)
4955 return a.__neg__(context=self)
4956
4957 def multiply(self, a, b):
4958 """multiply multiplies two operands.

Callers

nothing calls this directly

Calls 2

_convert_otherFunction · 0.85
__neg__Method · 0.45

Tested by

no test coverage detected