How to calculate log(x, 2) log2 in Python

1 Answer

0 votes
import math 
  
print(math.log2(8))  
print(math.log2(2))  
print(math.log2(0.4))



'''
run:

3.0
1.0
-1.3219280948873622

'''

 



answered Jul 13, 2019 by avibootz

Related questions

1 answer 193 views
2 answers 333 views
1 answer 242 views
1 answer 543 views
1 answer 225 views
1 answer 184 views
...