14 lines
316 B
Python
14 lines
316 B
Python
# advcalculator.py with sqrt,log and ln functions
|
|
import math
|
|
|
|
def sqrt(x):
|
|
"""This function takes square root of a number"""
|
|
return math.sqrt(x)
|
|
|
|
def log(x):
|
|
"""This function returns log of base 10"""
|
|
return math.log(x,10)
|
|
|
|
def ln(x):
|
|
"""This function returns log of base 2"""
|
|
return math.log(x,2) |