Value Factory Function--
bool (obj) : Returns obj the Boolean value of the object, which is obj.__nonzero__ () The return value of the method.
int (obj,base=10) : Returns an integer representation of a string or numeric object , similar to string.atoi ()
long (obj,base=10) : Returns a long integer representation of a string or numeric object , similar to string.atol ()
float (obj) : Returns a floating-point representation of a string or numeric object, similar to String.atof () .
Complex (str) : Returns the plural representation of a string or numeric object.
Complex (real,imag=0.0) : Generates a complex object based on a given real number and an optional imaginary part.
Numeric Operation Function--
ABS (num) : Returns Num the absolute value.
coerce (num1,num2) : num1 num2
divmod (num1,num2) : The combination of division and take-rest operations, returns a tuple (num1/num2,num1%num2) .
Pow (num1,num2,mod=1): TakeNUM1of thenum2The second party, if providedMoDparameter, the result of the calculation is thenMoDtake the remainder operation.
round (flt,ndig=0) : Accept a floating-point number Flt and rounding it up, saving Ndig decimal place.
Integer conversion Function--
Hex (num) : Converts a number to a hexadecimal number and returns as a string.
Oct (num) : Converts a number to an octal number and returns as a string.
CHR (num) : ascii Span style= "Font-family:wenquanyi Micro Hei" >ascii character, range can only be Span style= "Font-family:wenquanyi Micro Hei" >0<=num<=255
Ord (CHR): Accept aASCIIorUnicodecharacter, which is a string of length one, returns the correspondingASCIIorUnicodevalues.
unichr (num) : Accept Unicode value, returning the corresponding Unicode characters.
Numerical Correlation Module--
decimal : Decimal floating-point arithmetic class Decimal .
Array : An efficient array of values.
Math /cmath : Standard c library mathematical operations functions, general mathematical operations in math modules, complex operations in cmath Span style= "Font-family:wenquanyi Micro Hei" > module.
operator : A function implementation of a mathematical operator.
Random : Multiple pseudo-random number generators.
Built-in functions and modules related to numbers in Python