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

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

JavaScript中带有示例的Math.log10()方法

發(fā)布時(shí)間:2023/12/1 javascript 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 JavaScript中带有示例的Math.log10()方法 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

JavaScript | Math.log10()方法 (JavaScript | Math.log10() Method)

Math operations in JavaScript are handled using functions of math library in JavaScript. In this tutorial on Math.log10() method, we will learn about the log10() method and its working with examples.

JavaScript中的數(shù)學(xué)運(yùn)算是使用JavaScript中的數(shù)學(xué)庫函數(shù)處理的。 在有關(guān)Math.log10()方法的本教程中,我們將學(xué)習(xí)log10()方法及其示例。

Math.log10() is a function in math library of JavaScript that is used to support math's operation of finding logarithm with base 10 of a number.

Math.log10()是JavaScript數(shù)學(xué)庫中的一個(gè)函數(shù),用于支持?jǐn)?shù)學(xué)以10為底的對(duì)數(shù)查找運(yùn)算。

Syntax:

句法:

Math.log10(n);

Parameter(s):

參數(shù):

  • n – It takes only one value which is the number whose logarithm 10 (log10) is to be found.

    n –僅采用一個(gè)值,該值是要找到其對(duì)數(shù)10(log 10 )的數(shù)字。

Return value:

返回值:

The return type of this method is number, it returns the log10 of the given number.

此方法的返回類型為number ,它返回給定數(shù)字的log 10

Example 1: Finding the log10 of number

示例1:查找數(shù)字的對(duì)數(shù)10

<!DOCTYPE html><html><head><title>Page Title</title> </head><body><script>document.write(Math.log10(3) + "<br>");document.write(Math.log10(87) + "<br>");document.write(Math.log10(100) + "<br>");document.write(Math.log10(512));</script> </body></html>

Output

輸出量

Example 2: finding log of a string.

示例2:查找字符串的日志。

<!DOCTYPE html><html><head><title>Page Title</title> </head><body><script>document.write(Math.log10("Include help"));</script></body></html>

Output

輸出量

When a string is passed to the log10() method. It returns NaN denoting the passed value is not a number.

將字符串傳遞給log 10 ()方法時(shí) 。 它返回NaN表示傳遞的值不是數(shù)字。

Example 3: Find the log of a complex number.

示例3:查找復(fù)數(shù)的日志。

<!DOCTYPE html> <html><head><title>Page Title</title> </head><body><script>document.write(Math.log10(1 + 2 i));</script></body></html>

Output

輸出量

Invalid or unexpected token

翻譯自: https://www.includehelp.com/code-snippets/math-log10-method-with-example-in-javascript.aspx

總結(jié)

以上是生活随笔為你收集整理的JavaScript中带有示例的Math.log10()方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。