日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > java >内容正文

java

strictmath_Java StrictMath log10()方法与示例

發布時間:2023/12/1 java 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 strictmath_Java StrictMath log10()方法与示例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

strictmath

StrictMath類log10()方法 (StrictMath Class log10() method)

  • log10() method is available in java.lang package.

    log10()方法在java.lang包中可用。

  • log10() method is used to return the logarithm of the given (base 10) of the given argument in the method.

    log10()方法用于返回方法中給定參數的給定(以10為底)的對數。

  • log10() method is a static method so it is accessible with the class name and if we try to access the method with the class object then we will not get any error.

    log10()方法是靜態方法,因此可以使用類名進行訪問,如果嘗試使用類對象訪問該方法,則不會出現任何錯誤。

  • log10() method does not throw any exception.

    log10()方法不會引發任何異常。

Syntax:

句法:

public static double log10(double d);

Parameter(s):

參數:

  • double d – represents the double type argument.

    double d –表示double類型的參數。

Return value:

返回值:

The return type of this method is double – it returns the logarithm (base 10) of the given argument.

此方法的返回類型為double-返回給定參數的對數(以10為底)。

Note:

注意:

  • If we pass NaN, method returns NaN.

    如果傳遞NaN,則方法返回NaN。

  • If we pass a value which is equal to 10*N (Here, N is an integer value), method returns the N.

    如果我們傳遞的值等于10 * N (此處N是整數值),則方法返回N。

  • If we pass a positive infinity, method returns the same (i.e. positive infinity).

    如果我們傳遞一個正無窮大,則方法將返回相同的值(即正無窮大)。

  • If we pass 0 (negative or positive), method returns the negative infinity.

    如果傳遞0(負數或正數),則方法將返回負無窮大。

Example:

例:

// Java program to demonstrate the example of // log10(double d) method of StrictMath Class.public class Log10 {public static void main(String[] args) {// variable declarationsdouble d1 = 7.0 / 0.0;double d2 = -0.0;double d3 = 6054.2;// Display previous value of d1,d2,d3System.out.println("d1: " + d1);System.out.println("d2: " + d2);System.out.println("d3: " + d3);// Here , we will get (Infinity) because we are// passing parameter whose value is (-infinity)System.out.println("StrictMath.log10(d1): " + StrictMath.log10(d1));// Here , we will get (-Infinity) because we are// passing parameter whose value is (-0.0)System.out.println("StrictMath.log10(d2): " + StrictMath.log10(d2));// Here , we will get (log [10 raised to the power of the given argument])// and we are passing parameter whose value is (6054.2)System.out.println("StrictMath.log10(d3): " + StrictMath.log10(d3));} }

Output

輸出量

d1: Infinity d2: -0.0 d3: 6054.2 StrictMath.log10(d1): Infinity StrictMath.log10(d2): -Infinity StrictMath.log10(d3): 3.782056763740091

翻譯自: https://www.includehelp.com/java/strictmath-log10-method-with-example.aspx

strictmath

總結

以上是生活随笔為你收集整理的strictmath_Java StrictMath log10()方法与示例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。