>>> import math
>>> math.log(10, 1000)
0.33333333333333337
math.log2(x) #x is a number
logging.basicConfig(filename="logfilename.log", level=logging.INFO)
# Log Creation
logging.info('your text goes here')
logging.error('your text goes here')
logging.debug('your text goes here')
import math
#E.g log_2(8)
result = math.log(8,2)
import logging
logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.DEBUG)
logging.debug('This message should go to the log file')
logging.info('So should this')
logging.warning('And this, too')
logging.error('And non-ASCII stuff, too, like Øresund and Malmö')
//Logarithm Functions
print(math.log(10))
print(math.log(10, 10))
def log(x,base):
result = ln(x)/ln(base)
return result
def ln(x):
n = 100000.0
return n * ((x ** (1/n)) - 1)
print(log(2,4))
#code by fawlid