{
    "mode": "pydoc",
    "parameter": "math",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/math/json",
    "generated": "2026-06-02T14:15:53Z",
    "sections": {
        "NAME": {
            "content": "math\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module provides access to the mathematical functions\ndefined by the C standard.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "acos",
                    "content": "Return the arc cosine (measured in radians) of x.\n\nThe result is between 0 and pi.\n"
                },
                {
                    "name": "acosh",
                    "content": "Return the inverse hyperbolic cosine of x.\n"
                },
                {
                    "name": "asin",
                    "content": "Return the arc sine (measured in radians) of x.\n\nThe result is between -pi/2 and pi/2.\n"
                },
                {
                    "name": "asinh",
                    "content": "Return the inverse hyperbolic sine of x.\n"
                },
                {
                    "name": "atan",
                    "content": "Return the arc tangent (measured in radians) of x.\n\nThe result is between -pi/2 and pi/2.\n"
                },
                {
                    "name": "atan2",
                    "content": "Return the arc tangent (measured in radians) of y/x.\n\nUnlike atan(y/x), the signs of both x and y are considered.\n"
                },
                {
                    "name": "atanh",
                    "content": "Return the inverse hyperbolic tangent of x.\n"
                },
                {
                    "name": "ceil",
                    "content": "Return the ceiling of x as an Integral.\n\nThis is the smallest integer >= x.\n"
                },
                {
                    "name": "comb",
                    "content": "Number of ways to choose k items from n items without repetition and without order.\n\nEvaluates to n! / (k! * (n - k)!) when k <= n and evaluates\nto zero when k > n.\n\nAlso called the binomial coefficient because it is equivalent\nto the coefficient of k-th term in polynomial expansion of the\nexpression (1 + x)n.\n\nRaises TypeError if either of the arguments are not integers.\nRaises ValueError if either of the arguments are negative.\n"
                },
                {
                    "name": "copysign",
                    "content": "Return a float with the magnitude (absolute value) of x but the sign of y.\n\nOn platforms that support signed zeros, copysign(1.0, -0.0)\nreturns -1.0.\n"
                },
                {
                    "name": "cos",
                    "content": "Return the cosine of x (measured in radians).\n"
                },
                {
                    "name": "cosh",
                    "content": "Return the hyperbolic cosine of x.\n"
                },
                {
                    "name": "degrees",
                    "content": "Convert angle x from radians to degrees.\n"
                },
                {
                    "name": "dist",
                    "content": "Return the Euclidean distance between two points p and q.\n\nThe points should be specified as sequences (or iterables) of\ncoordinates.  Both inputs must have the same dimension.\n\nRoughly equivalent to:\nsqrt(sum((px - qx)  2.0 for px, qx in zip(p, q)))\n"
                },
                {
                    "name": "erf",
                    "content": "Error function at x.\n"
                },
                {
                    "name": "erfc",
                    "content": "Complementary error function at x.\n"
                },
                {
                    "name": "exp",
                    "content": "Return e raised to the power of x.\n"
                },
                {
                    "name": "expm1",
                    "content": "Return exp(x)-1.\n\nThis function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.\n"
                },
                {
                    "name": "fabs",
                    "content": "Return the absolute value of the float x.\n"
                },
                {
                    "name": "factorial",
                    "content": "Find x!.\n\nRaise a ValueError if x is negative or non-integral.\n"
                },
                {
                    "name": "floor",
                    "content": "Return the floor of x as an Integral.\n\nThis is the largest integer <= x.\n"
                },
                {
                    "name": "fmod",
                    "content": "Return fmod(x, y), according to platform C.\n\nx % y may differ.\n"
                },
                {
                    "name": "frexp",
                    "content": "Return the mantissa and exponent of x, as pair (m, e).\n\nm is a float and e is an int, such that x = m * 2.e.\nIf x is 0, m and e are both 0.  Else 0.5 <= abs(m) < 1.0.\n"
                },
                {
                    "name": "fsum",
                    "content": "Return an accurate floating point sum of values in the iterable seq.\n\nAssumes IEEE-754 floating point arithmetic.\n"
                },
                {
                    "name": "gamma",
                    "content": "Gamma function at x.\n"
                },
                {
                    "name": "gcd",
                    "content": "Greatest Common Divisor.\n"
                },
                {
                    "name": "hypot",
                    "content": "hypot(*coordinates) -> value\n\nMultidimensional Euclidean distance from the origin to a point.\n\nRoughly equivalent to:\nsqrt(sum(x2 for x in coordinates))\n\nFor a two dimensional point (x, y), gives the hypotenuse\nusing the Pythagorean theorem:  sqrt(x*x + y*y).\n\nFor example, the hypotenuse of a 3/4/5 right triangle is:\n\n>>> hypot(3.0, 4.0)\n5.0\n"
                },
                {
                    "name": "isclose",
                    "content": "Determine whether two floating point numbers are close in value.\n\nreltol\nmaximum difference for being considered \"close\", relative to the\nmagnitude of the input values\nabstol\nmaximum difference for being considered \"close\", regardless of the\nmagnitude of the input values\n\nReturn True if a is close in value to b, and False otherwise.\n\nFor the values to be considered close, the difference between them\nmust be smaller than at least one of the tolerances.\n\n-inf, inf and NaN behave similarly to the IEEE 754 Standard.  That\nis, NaN is not close to anything, even itself.  inf and -inf are\nonly close to themselves.\n"
                },
                {
                    "name": "isfinite",
                    "content": "Return True if x is neither an infinity nor a NaN, and False otherwise.\n"
                },
                {
                    "name": "isinf",
                    "content": "Return True if x is a positive or negative infinity, and False otherwise.\n"
                },
                {
                    "name": "isnan",
                    "content": "Return True if x is a NaN (not a number), and False otherwise.\n"
                },
                {
                    "name": "isqrt",
                    "content": "Return the integer part of the square root of the input.\n"
                },
                {
                    "name": "lcm",
                    "content": "Least Common Multiple.\n"
                },
                {
                    "name": "ldexp",
                    "content": "Return x * (2i).\n\nThis is essentially the inverse of frexp().\n"
                },
                {
                    "name": "lgamma",
                    "content": "Natural logarithm of absolute value of Gamma function at x.\n"
                },
                {
                    "name": "log",
                    "content": "log(x, [base=math.e])\nReturn the logarithm of x to the given base.\n\nIf the base not specified, returns the natural logarithm (base e) of x.\n"
                },
                {
                    "name": "log10",
                    "content": "Return the base 10 logarithm of x.\n"
                },
                {
                    "name": "log1p",
                    "content": "Return the natural logarithm of 1+x (base e).\n\nThe result is computed in a way which is accurate for x near zero.\n"
                },
                {
                    "name": "log2",
                    "content": "Return the base 2 logarithm of x.\n"
                },
                {
                    "name": "modf",
                    "content": "Return the fractional and integer parts of x.\n\nBoth results carry the sign of x and are floats.\n"
                },
                {
                    "name": "nextafter",
                    "content": "Return the next floating-point value after x towards y.\n"
                },
                {
                    "name": "perm",
                    "content": "Number of ways to choose k items from n items without repetition and with order.\n\nEvaluates to n! / (n - k)! when k <= n and evaluates\nto zero when k > n.\n\nIf k is not specified or is None, then k defaults to n\nand the function returns n!.\n\nRaises TypeError if either of the arguments are not integers.\nRaises ValueError if either of the arguments are negative.\n"
                },
                {
                    "name": "pow",
                    "content": "Return xy (x to the power of y).\n"
                },
                {
                    "name": "prod",
                    "content": "Calculate the product of all the elements in the input iterable.\n\nThe default start value for the product is 1.\n\nWhen the iterable is empty, return the start value.  This function is\nintended specifically for use with numeric values and may reject\nnon-numeric types.\n"
                },
                {
                    "name": "radians",
                    "content": "Convert angle x from degrees to radians.\n"
                },
                {
                    "name": "remainder",
                    "content": "Difference between x and the closest integer multiple of y.\n\nReturn x - n*y where n*y is the closest integer multiple of y.\nIn the case where x is exactly halfway between two multiples of\ny, the nearest even value of n is used. The result is always exact.\n"
                },
                {
                    "name": "sin",
                    "content": "Return the sine of x (measured in radians).\n"
                },
                {
                    "name": "sinh",
                    "content": "Return the hyperbolic sine of x.\n"
                },
                {
                    "name": "sqrt",
                    "content": "Return the square root of x.\n"
                },
                {
                    "name": "tan",
                    "content": "Return the tangent of x (measured in radians).\n"
                },
                {
                    "name": "tanh",
                    "content": "Return the hyperbolic tangent of x.\n"
                },
                {
                    "name": "trunc",
                    "content": "Truncates the Real x to the nearest Integral toward 0.\n\nUses the trunc magic method.\n"
                },
                {
                    "name": "ulp",
                    "content": "Return the value of the least significant bit of the float x.\n"
                }
            ]
        },
        "DATA": {
            "content": "e = 2.718281828459045\ninf = inf\nnan = nan\npi = 3.141592653589793\ntau = 6.283185307179586\n",
            "subsections": []
        },
        "FILE": {
            "content": "(built-in)\n\n",
            "subsections": []
        }
    },
    "summary": "math",
    "flags": [],
    "examples": [],
    "see_also": []
}