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