Icon
Login    Register          




Most Advanced AI

Generate Code at the speed of Thought

Improve Productivity of Developers



Python Tutorial

Python Math Functions

Python Math Functions are a set of built-in functions that allow you to perform mathematical operations on numbers. Below, we provide a small list of functions.

1. abs()

The abs() function returns the absolute value of a number. This means that it returns the number without its sign. For example, abs(-5) will return 5.

2. ceil()

The ceil() function returns the smallest integer greater than or equal to a given number. For example, ceil(3.14) will return 4.

3. floor()

The floor() function returns the largest integer less than or equal to a given number. For example, floor(3.14) will return 3.

4. max()

The max() function returns the largest number from a given list of numbers. For example, max([1,2,3,4]) will return 4.

5. min()

The min() function returns the smallest number from a given list of numbers. For example, min([1,2,3,4]) will return 1.

6. pow()

The pow() function returns the result of a number raised to a given power. For example, pow(2,3) will return 8.

7. round()

The round() function rounds a number to the nearest integer. For example, round(3.14) will return 3.

8. sqrt()

The sqrt() function returns the square root of a number. For example, sqrt(9) will return 3.

9. log()

The log() function returns the natural logarithm of a number. For example, log(2) will return 0.693.

10. sin()

The sin() function returns the sine of a number. For example, sin(90) will return 1.


Search Menu



Disclaimer:
Patodia Infotech Private Limited (fastdevai.com) has no responsibility for any text or code generated or for any action taken by you based on the contents provided by this web site. The use of this web site is solely at the user's risk. All the services are provided with the understanding that Patodia Infotech Private Limited or any other person or company associated with this company or website are not responsible for any loss or damage occurring to anybody from any code or contents generated by this website. Please note that text, codes and contents are generated by AI. These are state-of-the-art AI solutions. However, these are AI tools so there is no guarantee of accuracy of any code or contents generated.


Copyright © 2021-2024 Patodia Infotech Private Limited, All Rights Reserved.