The Math module for Python

Source: Internet
Author: User
Tags natural logarithm square root

Math Module Usage:
Import Math
# or
From Math Import *
Variable
Describe
Math.e
The base e of the natural logarithm
Math.PI
Pi
Name of function
Describe
Math.ceil (x)
Rounding x up, such as x=1.2, returns 2
Math.floor (x)
Rounding x down, such as x=1.2, returns 1
MATH.SQRT (x)
Returns the square root of X
Math.factorial (x)
Find the factorial of X
Math.log (x[, base])
Returns the logarithm of base x, if not given base, with the natural logarithm e as the base
MATH.LOG10 (x)
logarithm of base x for 10
Math.pow (x, y)
Return X**y (x's y-square)
Math.fabs (x)
Returns the absolute value of a floating-point number X
Angle and Radian degrees interchange

Math.degree (x)
Convert radians x to angles
Math.radians (x)
Convert angle X to radians
Trigonometric function

Math.sin (x)
Returns the sine of x (x is radians)
Math.Cos (x)
Returns the cosine of x (radians x)
Math.tan (x)
Returns the tangent of x (radians x)
Math.asin (x)
Returns the inverse sine of x (the return value is radians)
Math.acos (x)
Returns the inverse cosine of x (the return value is radians)
Math.atan (x)
Returns the inverse tangent of x (the return value is radians)

The Math module for Python

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.