1.math Introduction
>>>import Math #导入math模块 >>>dir (math) #这句可查看所有函数名列表 >>>help (math) # View specific definitions and function prototypes
2. Common functions
ACOs (x) # Return the arc cosine (measured in radians) of X.asin (x) # Return the arc sine (measured in radians) of X.atan (x) # Return the arc tangent (measured in radians) of x.atan2 (y, x) # Return the arc tangent (measured I n radians) of y/x. # unlike Atan (y/x), the signs of both X and Y are Considered.ceil (x) # Return The ceiling of x as a float. # This is the smallest integral value >= X.cos (x) # Return the cosine of x (measured in radians). cosh (x) # Return the hyperbolic (hyperbolic) cosine of x.degrees (x) # converts angle x from radians (radians) to Degreesexp (x) # Return e raised to the power of X.fabs (x) # Return the absolute value of the float X.floor (x) # return the Floo R of X as a float. # This is the largest integral value <= x.fmod (x, y) # Return Fmod-according to platform C. X% y May differ.frexp (x) # Return the mantissa and exponent of X, as pair (M, e). # m is a float and e are an int, such that x = M * 2.**e. # If x is 0, M and e are both 0. Else 0.5 <= ABS (M) < 1.0.hypot (x, y) # Return The Euclidean distance, sqrt (x*x + y*y). Ldexp (x, i) # x * (2**i) Lo G (x[, Base]) # The logarithm of x to the given base. # If The base not specified, returns the natural logarithm (base e) of X.log10 (x) # The base of logarithm of X.MODF (x ) # Return the fractional and integer parts of x. Both results carry the sign # of X. The integer part is returned as a real.pow (x, y) # Return X**y (× to the power of Y). radians (x) # converts angle X From degrees to Radianssin (x) # return the sine of x (measured in radians). Sinh (x) # return the hyperbolic si NE of X.sqrt (x) # return the square root of X.tan (x) # Return the tangent of x (measured in radians). Tanh (x) # Return the hyperbolic tangent of X.
In addition, the module defines two constants:
E = 2.7182818284590451pi = 3.1415926535897931
Python's Math module