Python‎ > ‎decimal‎ > ‎

Decimal.copy_abs()


Definition
Return the absolute value of the argument.

Syntax
Decimal(x).copy_abs()-> absolute value

Parameters
x=Decimal value

Examples
The return values are following:
 >>> Decimal(33.11).copy_abs()
Decimal('33.1099999999999994315
658113919198513031005859375')

>>> Decimal(-993.33).copy_abs()
Decimal('993.33000000000004092726
15797817707061767578125')

>>> Decimal(0).copy_abs()
Decimal('0')
>>>


The method binary bit value of a, not in b after applying the round() method to Decimal().conjugate() and Decimal().copy_abs()
import operator
from decimal import*

a=round(Decimal(33).conjugate())
b=round(Decimal(-133).copy_abs())

if operator.xor(a,b).__lt__(300):
    print(" Binary the bit set in", a, "not in" ,b, "is", operator.xor(a,b))
else:
    ValueError

>>> 
Binary the bit set in 33 not in 133 is 164
>>> 



Comments