1. ceil () : — This function returns the smallest integer value greater than a number . If the number is already an integer, the same number is returned.
2. floor () : — This function returns the largest integer value less than a number . If the number is already an integer, the same number is returned.
The ceil of 2.3 is: 3 The floor of 2.3 is: 2
3. fabs () : — this function returns the absolute value of a number.
4. factorial () : — This function returns the factorial of a number. An error message is displayed if the number is not an integer.
The absolute value of -10 is: 10.0 The factorial of 5 is: 120
5. copysign (a, b) : — This function returns a number with value "a" but signed "b" . The return value is of type float.
6. gcd () : — This function is used to compute the greatest common divisor of the two numbers mentioned in its arguments. This feature works in Python 3.5 and up.
The copysigned value of -10 and 5.5 is: -5.5 The gcd of 5 and 15 is: 5
This article is updated by Manjeet Singh If you love Python.Engineering and would like to contribute, you can also write article with contribute.python.engineering or post the article [email protected] See my article appearing on the Python.Engineering homepage and help other geeks.
Please post comments if you find anything wrong or if you would like to share more information on the topic discussed above.