主页
Python
Python math.log2() 方法
demo_ref_math_log2
运行 ❯
×
更改方向
保存代码
更改主题
# Import math Library import math # Return the base-2 logarithm of different numbers print(math.log2(2.7183)) print(math.log2(2)) print(math.log2(1))
1.4427046851812222
1.0
0.0