MCPcopy Index your code
hub / github.com/RustPython/RustPython / min_mag

Method min_mag

Lib/_pydecimal.py:4887–4902  ·  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

4885 return a.min(b, context=self)
4886
4887 def min_mag(self, a, b):
4888 """Compares the values numerically with their sign ignored.
4889
4890 >>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2'))
4891 Decimal('-2')
4892 >>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN'))
4893 Decimal('-3')
4894 >>> ExtendedContext.min_mag(1, -2)
4895 Decimal('1')
4896 >>> ExtendedContext.min_mag(Decimal(1), -2)
4897 Decimal('1')
4898 >>> ExtendedContext.min_mag(1, Decimal(-2))
4899 Decimal('1')
4900 """
4901 a = _convert_other(a, raiseit=True)
4902 return a.min_mag(b, context=self)
4903
4904 def minus(self, a):
4905 """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