JavaScript LN2 屬性
定義和用法
LN2 屬性就是 loge2,即 2 的自然對(duì)數(shù),其值近似于 0.69314718055994528623。
語法
Math.LN2
實(shí)例
返回 2 的自然對(duì)數(shù):
<script type="text/javascript">
document.write("LN2: " + Math.LN2
);
</script>
輸出:
LN2: 0.6931471805599453