首页 > 其他分享 >JS内置对象Math

JS内置对象Math

时间:2022-10-22 19:33:12浏览次数:50  
标签:内置 console log JS 自然对数 为底 平方根 Math

Math对象属性

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Math对象属性</title>
</head>

<body>

<script>
// 自然对数的基数e的值
console.log(Math.E); //2.718281828459045

//10为底的自然对数
console.log(Math.LN10); //2.302585092994046

//2为底的自然对数
console.log(Math.LN2); //0.6931471805599453

//以2为底的e的对数
console.log(Math.LOG2E); //1.4426950408889634

//以2为底的e的对数
console.log(Math.LOG10E); //0.4342944819032518

//π的值
console.log(Math.PI); //3.141592653589793

// 1/2的平方根
console.log(Math.SQRT1_2); //0.7071067811865476

// 2的平方根
console.log(Math.SQRT2); //1.4142135623730951
</script>
</body>

</html>

标签:内置,console,log,JS,自然对数,为底,平方根,Math
From: https://blog.51cto.com/u_15011997/5786083

相关文章

  • js隐式转换
    <script>//个人感觉是两边都调用了Numberconsole.log(true==1);//1==1----trueconsole.log(true=='1');//1==1----trueconsol......
  • Linux执行jsp命令的时候报错:-bash: jps: command not found
    前言:在zookeeper学习的时候,执行jsp命令查看zookpper运行状态的时候发现报错:-bash:jps:commandnotfound翻阅了一大批文章,不是东拼西凑,就是缺斤少两,于是乎,本人萌生了......
  • JSP include 和 forward的区别
    <jsp:include>动作元素用来包含静态和动态的文件。该动作把指定文件插入正在生成的页面。语法格式如下:<jsp:includepage="相对URL地址"flush="true"/>include指......
  • [RxJS] Append values to a stream using startWith and endWith (countdown$)
    //beginlessoncodeimport{interval,fromEvent,of}from'rxjs';import{scan,mapTo,takeWhile,takeUntil,tap,startWith,endWith}from'rxjs/operators......
  • [RxJS] Use filter and partition for conditional logic
    //beginlessoncodeimport{fromEvent,partition}from'rxjs';import{filter,pluck}from'rxjs/operators';constMOVE_SPEED=20;letleftPosition=0;......
  • [RxJS] Extract common operator logic into standalone function
    /**From*/click$.pipe(mergeMapTo(throwError({status:400,message:'Servererror'}).pipe(retryWhen(attempts=>{returnatt......
  • JSON
    https://baike.baidu.com/item/JSON/2462549?fr=aladdinJSON(JavaScript ObjectNotation,JS对象简谱)是一种轻量级的数据交换格式。它基于 ECMAScript(EuropeanComputer......
  • mathematical tip 1
    mathematicaltip标签(空格分隔):mathematics1.additiontimedifference2.transformation\((a+b)\times(a+(-b))=a^2-b^2\)->c:coefficients\((a+c\timesb)\t......
  • vue.js中实现阻止事件冒泡
    当父子元素中都有点击事件的时候,为了让触发子元素中的事件时,不去触发父元素中的事件,可以在子元素事件中添加stop来阻止事件冒泡。 .stop是阻止冒泡行为,不让当前元素的......
  • js 变量作用域与解构赋值| 22
    在JavaScript中,用​​var​​申明的变量实际上是有作用域的。如果一个变量在函数体内部申明,则该变量的作用域为整个函数体,在函数体外不可引用该变量:'usestrict';functionf......