Write Python program to demonstrate math built-in functions
Math’s built-in Functions: Here is the list of all the functions and attributes defined in math module
Write Python program to demonstrate math built-in functions |
Example
1.Write a program to perform all built in math built-in function
import math
print("Ceil function",math.ceil(1.2))
print("Floor function",math.floor(1.2))
print("power function",math.pow(2,3))
print("Copysign function",math.copysign(2,-1))
print("Factorial function",math.factorial(5))
print("fmod function",math.fmod(5,2))
print("sqrt function",math.sqrt(25))
print("gcd function",math.gcd(3,12))
print("exp function",math.exp(5))
import random as mp
print(mp.uniform(5,50));