From 2b3f034407b394bf8c93feaf1fb07fdae69f738f Mon Sep 17 00:00:00 2001 From: Jayjeet Chakraborty Date: Mon, 1 Oct 2018 19:15:57 +0530 Subject: [PATCH] Added samplemath.py --- samplemath.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 samplemath.py diff --git a/samplemath.py b/samplemath.py new file mode 100644 index 0000000..ae91f3b --- /dev/null +++ b/samplemath.py @@ -0,0 +1,46 @@ +import math + +'''Log to the base e''' +print(math.log(10)) + +'''Log to the base 2''' +print(math.log2(16)) + +'''Log to the base 10''' +print(math.log10(10)) + +'''Power function''' +print(math.pow(2,5)) + +'''Find square root''' +print(math.sqrt(16)) + +'''Exponent to base e''' +print(math.exp(3)) + +'''Return the gcd of 2 numbers''' +print(math.gcd(10,14)) + + +'''Find sine''' +print(math.sin(10)) + +'''Find cosine''' +print(math.cos(6)) + +'''Find tangent''' +print(math.tan(5)) + +'''Convert angle x from radians to degrees''' +print(math.degrees(3.14)) + +'''Convert angle x from degrees to radians''' +print(math.radians(60)) + + +'''PI value''' +print(math.pi) + +'''E Value''' +print(math.e) +