How to evaluate logarithms in Maxima?

こ雲淡風輕ζ 提交于 2019-12-10 10:25:11

问题


Following examples from here, and here I tried this:

log2(x) := log(x) / log(2);
log2(8), float;

But this doesn't give 3, instead I get log(8)/log(2).


回答1:


You have to simplify radicals:

(%i1) log2(x) := log(x) / log(2);
                                          log(x)
(%o1)                          log2(x) := ------
                                          log(2)
(%i2) radcan(log2(8));
(%o2) 

                             3



回答2:


or use float :

float(log(8)/log(2));

gives:

2.999999999999999


来源:https://stackoverflow.com/questions/36271504/how-to-evaluate-logarithms-in-maxima

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!