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)
| 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. |