Skip to content

Added samplemath.py #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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)