更新時間:2022-08-24 10:40:33 來源:動力節(jié)點(diǎn) 瀏覽1765次
該方法返回參數(shù)的自然對數(shù)。
句法
double log(double d)
參數(shù)
這是參數(shù)的詳細(xì)信息
d - 任何原始數(shù)據(jù)類型。
返回值
此方法返回參數(shù)的自然對數(shù)。
例子
public class Test {
public static void main(String args[]) {
double x = 11.635;
double y = 2.76;
System.out.printf("The value of e is %.4f%n", Math.E);
System.out.printf("log(%.3f) is %.3f%n", x, Math.log(x));
}
}
這將產(chǎn)生以下結(jié)果
輸出
The value of e is 2.7183
log(11.635) is 2.454
相關(guān)閱讀
初級 202925
初級 203221
初級 202629
初級 203743