xxxxxxxxxx
import math
print(math.log2(4))
print(math.log2(8))
print(math.log2(64))
print(math.log2(100))
xxxxxxxxxx
import logging
# Set up the logger
logging.basicConfig(level=logging.DEBUG)
# Log messages
logging.debug("Debug message")
logging.info("Info message")
logging.warning("Warning message")
logging.error("Error message")
logging.critical("Critical message")
xxxxxxxxxx
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
xxxxxxxxxx
# Python program explaining
# log() function
import numpy as np
in_array = [1, 3, 5, 2**8]
print ("Input array : ", in_array)
out_array = np.log(in_array)
print ("Output array : ", out_array)
print("\nnp.log(4**4) : ", np.log(4**4))
print("np.log(2**8) : ", np.log(2**8))