Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions samplemath.py
Original file line number Diff line number Diff line change
@@ -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)