• Note there is no cmath counterpart of the math.inf and math.nan constants (from Python 3.5 and higher). cmath.isinf(complex(0.0, math.inf)) # Out: True.
  • Python logo. Theme. Auto Light Dark. Table of Contents. mathMathematical functions. Number-theoretic and representation functions.
  • Python’s math library makes it simple to conduct complex mathematical operations without requiring complex mathematical calculations.
  • Python has a built-in module that you can use for mathematical tasks. The math module has a set of methods and constants.
  • The different Python math module functions necessary in theory and number history are covered in this part: Calculating the Ceiling and the Floor Value.
  • To use Python math functions, you have to import the module using the import math line at the starting of the program to get the math class object.
  • The Python math Library provides various Functions and Constants / Properties, which allows us to perform mathematical functionality.
  • Python math module covers the most used number-theoretic functions, power functions, logarithmic function, trigonometric function, hyperbolic functions...