Python‎ > ‎operator‎ > ‎

operator.ipow()

http://www.adilwaseem.com/

Examples
The method return the value:
 >>> import operator
>>> operator.ipow(3,5)
243
>>> operator.ipow(1,2)
1
>>> operator.ipow(3,0)
1
>>> operator.ipow(0,3)
0

operator.__ipow__
The method return the same value:
>>> import operator
>>> operator.__ipow__(3,5)
243

The value of two operation are:
 >>> import operator
>>> operator.ipow(2,3)
8
>>> pow(2,3)
8

Testing equality between method:
 >>> import operator
>>> a=operator.ipow(3,4)
>>> b=pow(3,4)
>>> a.__gt__(b)
False

__add__
The value added in:
 >>> import operator
>>> a=operator.ipow(3,4)
>>> b=pow(3,4)
>>> a.__add__(b)
162

__eq__
The equality is tested in:
 >>> import operator
>>> a=operator.ipow(3,4)
>>> b=pow(3,4)
>>> a.__eq__(b)
True

The returns are:
 >>> a= Decimal(2.31).compare_total_mag(Decimal(9.22))
>>> b=Decimal('-1')
>>> operator.ipow(a,b)
Decimal('-1')




Comments