Phương thức log10() của toán học Java
Ví dụ
Trả về logarit cơ số 10 cho các số khác nhau:
System.out.println(Math.log10(120)); System.out.println(Math.log10(10)); System.out.println(Math.log10(3.1623)); System.out.println(Math.log10(1)); System.out.println(Math.log10(0)); System.out.println(Math.log10(-1));
Định nghĩa và cách sử dụng
Phương thức log10()
trả về logarit cơ số 10 của một số.
Cú pháp
public static double log10(double number )
Giá trị tham số
Parameter | Description |
---|---|
number | Required. Specifies the value to calculate the logarithm for. If the value is negative, it returns NaN (Not a Number). If the value is 0, it returns -Infinity. |
Chi tiết kỹ thuật
Trả về: | Một giá trị double biểu thị logarit cơ số 10 của một số. |
---|---|
Phiên bản Java: | 1,5+ |
❮ Phương pháp Toán