|
| https://realpython.com/ |
| Start Here | https://realpython.com/start-here/ |
|
Learn Python
| https://realpython.com/courses/exploring-python-math-module/continue/ |
| Python Tutorials →In-depth articles and video courses | https://realpython.com/search?kind=article&kind=course&order=newest |
| Learning Paths →Guided study plans for accelerated learning | https://realpython.com/learning-paths/ |
| Quizzes & Exercises →Check your learning progress | https://realpython.com/quizzes/ |
| Browse Topics →Focus on a specific area or skill level | https://realpython.com/tutorials/all/ |
| Community Chat →Learn with other Pythonistas | https://realpython.com/community/ |
| Office Hours →Live Q&A calls with Python experts | https://realpython.com/office-hours/ |
| Podcast →Hear what’s new in the world of Python | https://realpython.com/podcasts/rpp/ |
| Books →Round out your knowledge and learn offline | https://realpython.com/products/books/ |
| Reference →Concise definitions for common Python terms | https://realpython.com/ref/ |
| Code Mentor →BetaPersonalized code assistance & learning tools | https://realpython.com/mentor/ |
| Unlock All Content → | https://realpython.com/account/join/ |
|
More
| https://realpython.com/courses/exploring-python-math-module/continue/ |
| Learner Stories | https://realpython.com/learner-stories/ |
| Python Newsletter | https://realpython.com/newsletter/ |
| Python Job Board | https://www.pythonjobshq.com |
| Meet the Team | https://realpython.com/team/ |
| Become a Tutorial Writer | https://realpython.com/write-for-us/ |
| Become a Video Instructor | https://realpython.com/become-an-instructor/ |
| Search | https://realpython.com/search |
| https://realpython.com/search |
| Join | https://realpython.com/account/join/ |
| Sign‑In | https://realpython.com/account/login/?next=%2Fvideos%2Fpython-math-module-overview%2F |
| https://realpython.com/courses/exploring-python-math-module/#team |
| Exploring the Python math Module | https://realpython.com/courses/exploring-python-math-module/ |
| Cesar Aguilar | https://realpython.com/courses/exploring-python-math-module/#team |
| Recommended Tutorial | https://realpython.com/python-math-module/ |
| Course Slides (.pdf) | https://realpython.com/courses/exploring-python-math-module/downloads/math-module-course-slides/ |
| Sample Code (.zip) | https://realpython.com/courses/exploring-python-math-module/downloads/math-module-course-code/ |
| Ask a Question | https://realpython.com/courses/exploring-python-math-module/continue/#discussion |
| https://realpython.com/feedback/survey/course/exploring-python-math-module/liked/?from=lesson-title |
| https://realpython.com/feedback/survey/course/exploring-python-math-module/disliked/?from=lesson-title |
| Contents | https://realpython.com/courses/exploring-python-math-module/continue/#description |
| Transcript | https://realpython.com/courses/exploring-python-math-module/continue/#transcript |
| Discussion | https://realpython.com/courses/exploring-python-math-module/continue/#discussion |
| module | https://realpython.com/python-modules-packages/ |
| mathmodule.c.mlog | GitHub | https://github.com/python/cpython/blob/main/Modules/mathmodule.c#L732 |
| math — Mathematical functions | Python Docs | https://docs.python.org/3/library/math.html |
| Sample Code (.zip) | https://realpython.com/courses/exploring-python-math-module/downloads/math-module-course-code/ |
| Course Slides (.pdf) | https://realpython.com/courses/exploring-python-math-module/downloads/math-module-course-slides/ |
| 00:00 | https://realpython.com/courses/exploring-python-math-module/continue/#t=0.51 |
| Hi, I’m Cesar. Welcome to this Real Python video course on the math module. | https://realpython.com/courses/exploring-python-math-module/continue/#t=0.51 |
| 00:06 | https://realpython.com/courses/exploring-python-math-module/continue/#t=6.46 |
| What is the math module? | https://realpython.com/courses/exploring-python-math-module/continue/#t=6.46 |
| The math module provides access to some of the mathematical functions defined by | https://realpython.com/courses/exploring-python-math-module/continue/#t=8.74 |
| the C standard library, and much more. | https://realpython.com/courses/exploring-python-math-module/continue/#t=12.67 |
| 00:16 | https://realpython.com/courses/exploring-python-math-module/continue/#t=16.03 |
| The module contains functions that perform computations from number theory, | https://realpython.com/courses/exploring-python-math-module/continue/#t=16.03 |
| combinatorics, trigonometry, geometry, | https://realpython.com/courses/exploring-python-math-module/continue/#t=21.43 |
| and classification. | https://realpython.com/courses/exploring-python-math-module/continue/#t=26.11 |
| Many math module functions are thin wrappers around C math library functions. | https://realpython.com/courses/exploring-python-math-module/continue/#t=28.39 |
| 00:33 | https://realpython.com/courses/exploring-python-math-module/continue/#t=33.01 |
| Let me show you one. | https://realpython.com/courses/exploring-python-math-module/continue/#t=33.01 |
| 00:35 | https://realpython.com/courses/exploring-python-math-module/continue/#t=35.72 |
| If you go to the GitHub repository for Python, | https://realpython.com/courses/exploring-python-math-module/continue/#t=35.72 |
| go over to the CPython directory, | https://realpython.com/courses/exploring-python-math-module/continue/#t=38.42 |
| you’ll find the mathmodule.c function. In that file, | https://realpython.com/courses/exploring-python-math-module/continue/#t=40.94 |
| you’ll see this definition for the m_log() function, | https://realpython.com/courses/exploring-python-math-module/continue/#t=45.14 |
| which implements the logarithm function that we’ll talk about in this course. | https://realpython.com/courses/exploring-python-math-module/continue/#t=48.89 |
| 00:53 | https://realpython.com/courses/exploring-python-math-module/continue/#t=53.57 |
| If you take a look at this code, | https://realpython.com/courses/exploring-python-math-module/continue/#t=53.57 |
| you see that this is a very thin wrapper around the logarithm function in the C | https://realpython.com/courses/exploring-python-math-module/continue/#t=54.95 |
| standard library. | https://realpython.com/courses/exploring-python-math-module/continue/#t=59.75 |
| 01:02 | https://realpython.com/courses/exploring-python-math-module/continue/#t=62.45 |
| But the math module functions do more than just this. | https://realpython.com/courses/exploring-python-math-module/continue/#t=62.45 |
| There are some nice functions that were added in Python 3.8, and we’ll discuss | https://realpython.com/courses/exploring-python-math-module/continue/#t=65.42 |
| these. So, why use the math module? Well, | https://realpython.com/courses/exploring-python-math-module/continue/#t=69.2 |
| for one thing, it’s part of the standard library of Python, | https://realpython.com/courses/exploring-python-math-module/continue/#t=73.95 |
| so there’s no need for a separate installation. | https://realpython.com/courses/exploring-python-math-module/continue/#t=76.95 |
| 01:19 | https://realpython.com/courses/exploring-python-math-module/continue/#t=79.41 |
| All you do is import the module with import math. | https://realpython.com/courses/exploring-python-math-module/continue/#t=79.41 |
| The math module functions have been tested and optimized to give accurate | https://realpython.com/courses/exploring-python-math-module/continue/#t=83.61 |
| results, so there’s no need to reinvent the wheel to perform basic math. | https://realpython.com/courses/exploring-python-math-module/continue/#t=87.15 |
| 01:31 | https://realpython.com/courses/exploring-python-math-module/continue/#t=91.98 |
| Just load the module and get going. | https://realpython.com/courses/exploring-python-math-module/continue/#t=91.98 |
| 01:35 | https://realpython.com/courses/exploring-python-math-module/continue/#t=95.86 |
| Here are the topics that we’ll discuss in the course. | https://realpython.com/courses/exploring-python-math-module/continue/#t=95.86 |
| We’ll go over some of the constants in the math module. | https://realpython.com/courses/exploring-python-math-module/continue/#t=98.35 |
| Then we’ll talk about arithmetic functions, and then power functions, | https://realpython.com/courses/exploring-python-math-module/continue/#t=101.5 |
| the exponential functions, logarithmic functions, | https://realpython.com/courses/exploring-python-math-module/continue/#t=104.89 |
| and other functions in the math module, | https://realpython.com/courses/exploring-python-math-module/continue/#t=107.89 |
| and then we’ll take a look at some of the new additions in Python 3.8. | https://realpython.com/courses/exploring-python-math-module/continue/#t=110.14 |
| 01:54 | https://realpython.com/courses/exploring-python-math-module/continue/#t=114.55 |
| Then we’ll discuss the differences between the cmath module— | https://realpython.com/courses/exploring-python-math-module/continue/#t=114.55 |
| which deals with complex numbers—and the math module, and NumPy and the math | https://realpython.com/courses/exploring-python-math-module/continue/#t=118.3 |
| module. We’ll wrap things up with the summary. | https://realpython.com/courses/exploring-python-math-module/continue/#t=122.95 |
| 02:07 | https://realpython.com/courses/exploring-python-math-module/continue/#t=127.78 |
| Now, I’m eager to get going and I bet you are too, | https://realpython.com/courses/exploring-python-math-module/continue/#t=127.78 |
| but one last important thing before we do: All of the code in this course was | https://realpython.com/courses/exploring-python-math-module/continue/#t=130.12 |
| tested in Python 3.9. | https://realpython.com/courses/exploring-python-math-module/continue/#t=134.23 |
| You should be fine with Python 3.8, and probably even as low as 3.5, | https://realpython.com/courses/exploring-python-math-module/continue/#t=136.81 |
| but if you do want to test the new functions that were added in Python 3.8, | https://realpython.com/courses/exploring-python-math-module/continue/#t=142.06 |
| you may want to have at least that version of Python installed. | https://realpython.com/courses/exploring-python-math-module/continue/#t=146.44 |
| 02:30 | https://realpython.com/courses/exploring-python-math-module/continue/#t=150.64 |
| All right, enough with the particulars. Let’s get going with this course. | https://realpython.com/courses/exploring-python-math-module/continue/#t=150.64 |
| Become a Member | https://realpython.com/account/join/ |
| Overview | https://realpython.com/courses/exploring-python-math-module/ |
| https://realpython.com/videos/constants-math-module/ |
|
Exploring the Python math Module (Overview) 02:35
| https://realpython.com/videos/python-math-module-overview/ |
|
Constants of the math Module 07:02
| https://realpython.com/videos/constants-math-module/ |
|
Arithmetic Functions: Factorials 07:22
| https://realpython.com/videos/arithmetic-functions-factorials/ |
|
Arithmetic Functions: Rounding 04:06
| https://realpython.com/videos/arithmetic-functions-rounding/ |
|
Arithmetic Functions: Checking For Closeness 06:36
| https://realpython.com/lessons/arithmetic-functions-closeness/ |
|
Power Functions 06:26
| https://realpython.com/lessons/power-functions/ |
|
Exponential Functions: math.exp() 04:43
| https://realpython.com/lessons/exponential-functions-math-exp/ |
|
Exponential Functions: Radioactive Decay 04:26
| https://realpython.com/lessons/exponential-functions-radioactive-decay/ |
|
Logarithmic Functions: math.log() 05:52
| https://realpython.com/lessons/logarithmic-functions-math-log/ |
|
Logarithmic Functions: Half-Lives 07:03
| https://realpython.com/lessons/logarithmic-functions-half-lives/ |
|
Other Important math Functions: gcd() 04:59
| https://realpython.com/lessons/other-math-functions-introduced/ |
|
Other Important math Functions: fsum(), sqrt(), and More 04:12
| https://realpython.com/lessons/other-math-functions-continued/ |
|
New math Functions in Python 3.8 07:00
| https://realpython.com/lessons/new-math-functions-python-38/ |
|
The cmath Module vs the math Module 05:19
| https://realpython.com/lessons/cmath-vs-math/ |
|
The NumPy Module vs the math Module 02:13
| https://realpython.com/lessons/numpy-vs-math/ |
|
Exploring the Python math Module (Summary) 00:56
| https://realpython.com/lessons/python-math-module-summary/ |
| Privacy Policy | https://realpython.com/privacy-policy/ |
Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover