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

Method max_mag

Lib/_pydecimal.py:4846–4861  ·  view source on GitHub ↗

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

(self, a, b)

Source from the content-addressed store, hash-verified

4844 return a.max(b, context=self)
4845
4846 def max_mag(self, a, b):
4847 """Compares the values numerically with their sign ignored.
4848
4849 >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN'))
4850 Decimal('7')
4851 >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10'))
4852 Decimal('-10')
4853 >>> ExtendedContext.max_mag(1, -2)
4854 Decimal('-2')
4855 >>> ExtendedContext.max_mag(Decimal(1), -2)
4856 Decimal('-2')
4857 >>> ExtendedContext.max_mag(1, Decimal(-2))
4858 Decimal('-2')
4859 """
4860 a = _convert_other(a, raiseit=True)
4861 return a.max_mag(b, context=self)
4862
4863 def min(self, a, b):
4864 """min compares two values numerically and returns the minimum.

Callers 1

test_max_magMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
max_magMethod · 0.45

Tested by 1

test_max_magMethod · 0.76