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

Method max_mag

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

4841 return a.max(b, context=self)
4842
4843 def max_mag(self, a, b):
4844 """Compares the values numerically with their sign ignored.
4845
4846 >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN'))
4847 Decimal('7')
4848 >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10'))
4849 Decimal('-10')
4850 >>> ExtendedContext.max_mag(1, -2)
4851 Decimal('-2')
4852 >>> ExtendedContext.max_mag(Decimal(1), -2)
4853 Decimal('-2')
4854 >>> ExtendedContext.max_mag(1, Decimal(-2))
4855 Decimal('-2')
4856 """
4857 a = _convert_other(a, raiseit=True)
4858 return a.max_mag(b, context=self)
4859
4860 def min(self, a, b):
4861 """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