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

Method plus

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

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')) De

(self, a)

Source from the content-addressed store, hash-verified

5136 return a.number_class(context=self)
5137
5138 def plus(self, a):
5139 """Plus corresponds to unary prefix plus in Python.
5140
5141 The operation is evaluated using the same rules as add; the
5142 operation plus(a) is calculated as add('0', a) where the '0'
5143 has the same exponent as the operand.
5144
5145 >>> ExtendedContext.plus(Decimal('1.3'))
5146 Decimal('1.3')
5147 >>> ExtendedContext.plus(Decimal('-1.3'))
5148 Decimal('-1.3')
5149 >>> ExtendedContext.plus(-1)
5150 Decimal('-1')
5151 """
5152 a = _convert_other(a, raiseit=True)
5153 return a.__pos__(context=self)
5154
5155 def power(self, a, b, modulo=None):
5156 """Raises a to the power of b, to modulo if given.

Callers

nothing calls this directly

Calls 2

_convert_otherFunction · 0.85
__pos__Method · 0.45

Tested by

no test coverage detected