mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-12-16 07:51:52 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<h2 id="Summary" name="Summary">概述</h2>
|
||||
<p><code><strong>Math.cbrt()</strong></code> 函数返回任意数字的立方根.</p>
|
||||
<h2 id="Syntax" name="Syntax">语法</h2>
|
||||
<pre class="syntaxbox">Math.cbrt(<em>x</em>)</pre>
|
||||
<pre><code class="language-javascript">Math.cbrt(<em>x</em>)</code></pre>
|
||||
<h3 id="Parameters" name="Parameters">参数</h3>
|
||||
<dl>
|
||||
<dt><code>x</code></dt>
|
||||
@@ -14,7 +14,7 @@
|
||||
<p>参数 <code>x</code> 会被自动类型转换成 <code>number </code>类型.</p>
|
||||
<p><span style="font-family: 'Courier New','Andale Mono',monospace; font-weight: inherit; line-height: normal;">cbrt 是 "cube root" 的缩写, 意思是立方根.</span></p>
|
||||
<h2 id="Examples" name="Examples">示例</h2>
|
||||
<pre class="brush: js">Math.cbrt(NaN); // NaN
|
||||
<pre><code class="language-javascript">Math.cbrt(NaN); // NaN
|
||||
Math.cbrt(-1); // -1
|
||||
Math.cbrt(-0); // -0
|
||||
Math.cbrt(-Infinity); // -Infinity
|
||||
@@ -22,15 +22,15 @@ Math.cbrt(0); // 0
|
||||
Math.cbrt(1); // 1
|
||||
Math.cbrt(Infinity); // Infinity
|
||||
Math.cbrt(null); // 0
|
||||
Math.cbrt(2); // 1.2599210498948734</pre>
|
||||
Math.cbrt(2); // 1.2599210498948734</code></pre>
|
||||
<h2 id="Polyfill"><font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.5);">Polyfill</span></font></h2>
|
||||
<p>为了与旧版浏览器兼容, 可使用下方函数模拟cbrt():</p>
|
||||
<pre class="brush: js" dir="rtl">if (!Math.cbrt) {
|
||||
<pre><code class="language-js" dir="rtl">if (!Math.cbrt) {
|
||||
Math.cbrt = function(x) {
|
||||
var y = Math.pow(Math.abs(x), 1/3);
|
||||
return x < 0 ? -y : y;
|
||||
};
|
||||
}</pre>
|
||||
}</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user