1. ABS (): Returns the absolute value of the given parameter. If the argument is a complex number, it returns the modulus of the complex number, that is, the square root of the sum of the real and imaginary parts of the complex number:
>>>abs ( -1)1>>>abs ( -56.78e-2)0.5678>>> (3+4j)5.0
2.coerce () (function in Python 2): Returns an element tuple containing two numeric values for the type conversion:
>>>coerce (2l,33) (2l,33l)>>>coerce (2l,33.0)(2.0,33.0)> >>coerce (2+3j,33.0)((2+3j), (33+0J))
3.divmod (): Combines the addition and subtraction operations to return a tuple containing quotient and remainder. The result of Divmod (N1,N2) is (N1//N2,N1%N2). Note: The function in Python2 supports complex numbers, but complex numbers are no longer supported in Python3.
>>>divmod (8.3,4) (2.0,0.3000000000000007)>>>divmod (2+3j,2) (1+0J), 3j)>>>divmod (2+3j,0+2j) ((1+0j), (2+1j))
4.pow (): Similar operator * *, can perform exponential operation, and can accept three parameters. The 1th and 2 parameters are exponential, and then the result is evaluated to the third parameter for the remainder operation. This feature is primarily used for cryptographic operations.
>>>pow (2,3)8>>>pow (2,3,5)3>>>pow (2+3j,2)(-5+12j)
5.round (): Used for rounding operations on floating-point numbers. Has an optional parameter that represents the number of decimal digits returned. If no optional argument returns the integer closest to the first parameter (still floating-point):
>>>round (2.45678)2.0>>>round ( -2.45678,1)-2.5>>>round (2.45678,2 )2.46
Python Digital Function function