MCPcopy Index your code
hub / github.com/python/cpython / copy_abs

Method copy_abs

Lib/_pydecimal.py:4276–4287  ·  view source on GitHub ↗

Returns a copy of the operand with the sign set to 0. >>> ExtendedContext.copy_abs(Decimal('2.1')) Decimal('2.1') >>> ExtendedContext.copy_abs(Decimal('-100')) Decimal('100') >>> ExtendedContext.copy_abs(-1) Decimal('1')

(self, a)

Source from the content-addressed store, hash-verified

4274 return a.compare_total_mag(b)
4275
4276 def copy_abs(self, a):
4277 """Returns a copy of the operand with the sign set to 0.
4278
4279 >>> ExtendedContext.copy_abs(Decimal('2.1'))
4280 Decimal('2.1')
4281 >>> ExtendedContext.copy_abs(Decimal('-100'))
4282 Decimal('100')
4283 >>> ExtendedContext.copy_abs(-1)
4284 Decimal('1')
4285 """
4286 a = _convert_other(a, raiseit=True)
4287 return a.copy_abs()
4288
4289 def copy_decimal(self, a):
4290 """Returns a copy of the decimal object.

Callers 2

test_copy_absMethod · 0.95
test_copyMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
copy_absMethod · 0.45

Tested by 2

test_copy_absMethod · 0.76
test_copyMethod · 0.76