What does that mean in Python 23

Lesson 2
Integer and glide ratio

3.Math module

Python has many auxiliary functions for calculations with floating point numbers. You can be in.

To use this module we must first import it by writing the following statement at the beginning of the program:

import math

For example, if we want to find a maximum value for - the smallest integer not less than - we call the corresponding function from the math module:. The syntax for calling functions from modules is always the same:

Noneimport math x = math.ceil (4.2) print (x) print (math.ceil (1 + 3.8))

There is another way to use functions from modules: to import certain functions by naming them:

Nonefrom math import ceil x = 7/2 y = ceil (x) print (y)

Some of the functions that focus on numbers -, and (absolute value aka module) - are built in and do not require imports.

All functions of a standard Python module are documented on the official Python website. Here is the description for math module. The description of some functions is given:

function description
Return the floor of x, the largest integer less than or equal to x.
Returns the upper bound of x, the smallest integer greater than or equal to x.
Roots and logarithms
Return the square root of x
Return the natural logarithm of x (base e) with one argument. With two arguments, return the logarithm of x to the specified base
The mathematical constant e = 2.71828 ...
Return the sine of x radians
Return the arc of x in radians
The mathematical constant π = 3,1415 ...