2 示例:求ln(2)的值
#include<stdio.h>
#include<math.h>
int main(){
double n = 2
double result = log(n)
printf("铅颂宴%lf", result)
getchar()
return 0
}
python+ln函数怎么打你好亲ln()是贺扮或一个Decimal类方法。它返回Decimal值的自然(对数e)对数缺销。用法:Decimal.ln()参数:十进制值返回:十进制值的自然禅伍(以e为底)对数。ln()使用方法示例:#PythonProgramexplaining#ln()method#loadingdecimallibraryfromdecimalimport*#Initializingadecimalvaluea=Decimal('.9932')b=Decimal('0.142857')#printingDecimalvaluesprint("Decimalvaluea:",a)print("Decimalvalueb:",b)#UsingDecimal.ln()methodprint("\n\nDecimalawithln()method:",a.ln())print("Decimalbwithln()method:",b.ln())输出:Decimalvaluea:0.9932Decimalvalueb:0.142857Decimalawithln()method:-0.006823225348125508334064182053Decimalbwithln()method:-1.945911149055813305438686327希望可以帮助的到您!欢迎分享,转载请注明来源:内存溢出
评论列表(0条)