Python‎ > ‎decimal‎ > ‎

Decimal.max_mag()


Definition
Similar to the max() method, but the 
comparison is done using the absolute values of the operands.

Syntax
Decimal(x).max_mag(y)

Parameters
x=Decimal
y=absolute integer 

Examples
The return is:
 >>> Decimal(1.2).max_mag(0)
Decimal('1.199999999999999955591079015')
>>> Decimal(0).max_mag(1)
Decimal('1')
>>> Decimal(1).max_mag(1)
Decimal('1')
>>> Decimal(.1).max_mag(1)
Decimal('1')
>>>


Comments