filmov
tv
math module in python

Показать описание
In this video you will learn about various functions of math module in python.
math module python
The math module is a built in module in python. It provides mathematical functions. To use its functions we have to import it. The commonly used methods of math module are as follows:
• fabs(): This methods removes – sign from a number and returns positive float equivalent of that number. Gives TypeError if we provide a parameter which is not a number.
import math
• ceil(): This method rounds a number upwards to the nearest integer. If we provide a non-numeric parameter, it gives TypeError.
import math
• floor(): This method rounds a number downwards to the nearest integer.
import math
• trunc() : Takes a number as argument and returns the truncated integer part.
import math
• factorial(): Returns the factorial value of a given number.
import math
• gcd() : This method returns the highest value that can divide two integers. This is known as greatest common divisor or highest common factor.
import math
• sqrt() : This method returns square root of a given number.
import math
The math module also provides several mathematical constants like pi, tau , e , nan, and inf etc.
The module also provides several methods like cos(), sin(), tan() , cosh(), sinh(), tanh(), exp(), log and many more.
For more details you can go to the following official python 3 documentation.
#python_by_tarun_sir #tarun_sir #python #tarun_sir_python #python_video_57 #math_module_in_python #python_tutorial #factorial_function_in_python #gcd_function_in_python
math module python
The math module is a built in module in python. It provides mathematical functions. To use its functions we have to import it. The commonly used methods of math module are as follows:
• fabs(): This methods removes – sign from a number and returns positive float equivalent of that number. Gives TypeError if we provide a parameter which is not a number.
import math
• ceil(): This method rounds a number upwards to the nearest integer. If we provide a non-numeric parameter, it gives TypeError.
import math
• floor(): This method rounds a number downwards to the nearest integer.
import math
• trunc() : Takes a number as argument and returns the truncated integer part.
import math
• factorial(): Returns the factorial value of a given number.
import math
• gcd() : This method returns the highest value that can divide two integers. This is known as greatest common divisor or highest common factor.
import math
• sqrt() : This method returns square root of a given number.
import math
The math module also provides several mathematical constants like pi, tau , e , nan, and inf etc.
The module also provides several methods like cos(), sin(), tan() , cosh(), sinh(), tanh(), exp(), log and many more.
For more details you can go to the following official python 3 documentation.
#python_by_tarun_sir #tarun_sir #python #tarun_sir_python #python_video_57 #math_module_in_python #python_tutorial #factorial_function_in_python #gcd_function_in_python
Комментарии