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

Method min_mag

Lib/_pydecimal.py:4890–4905  ·  view source on GitHub ↗

Compares the values numerically with their sign ignored. >>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2')) Decimal('-2') >>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN')) Decimal('-3') >>> ExtendedContext.min_mag(1, -2) Decimal('1')

(self, a, b)

Source from the content-addressed store, hash-verified

4888 return a.min(b, context=self)
4889
4890 def min_mag(self, a, b):
4891 """Compares the values numerically with their sign ignored.
4892
4893 >>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2'))
4894 Decimal('-2')
4895 >>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN'))
4896 Decimal('-3')
4897 >>> ExtendedContext.min_mag(1, -2)
4898 Decimal('1')
4899 >>> ExtendedContext.min_mag(Decimal(1), -2)
4900 Decimal('1')
4901 >>> ExtendedContext.min_mag(1, Decimal(-2))
4902 Decimal('1')
4903 """
4904 a = _convert_other(a, raiseit=True)
4905 return a.min_mag(b, context=self)
4906
4907 def minus(self, a):
4908 """Minus corresponds to unary prefix minus in Python.

Callers 1

test_min_magMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
min_magMethod · 0.45

Tested by 1

test_min_magMethod · 0.76