diff options
| author | t7yang <t7yang@gmail.com> | 2022-01-10 08:38:07 +0800 |
|---|---|---|
| committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
| commit | c40612041809fe289aba58aefa170bbe784aba1f (patch) | |
| tree | 8ca89b071d04afcf7abd6d9a04d0765a041d9c8a /files/zh-cn/web/javascript/reference/global_objects/math/fround | |
| parent | 12a899ab8540bc84f56a0dc6491be80a48499d49 (diff) | |
| download | translated-content-c40612041809fe289aba58aefa170bbe784aba1f.tar.gz translated-content-c40612041809fe289aba58aefa170bbe784aba1f.tar.bz2 translated-content-c40612041809fe289aba58aefa170bbe784aba1f.zip | |
remove name attribute for zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/math/fround')
| -rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/math/fround/index.html | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/math/fround/index.html b/files/zh-cn/web/javascript/reference/global_objects/math/fround/index.html index f5118b4a22..b4790b6448 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/math/fround/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/math/fround/index.html @@ -5,26 +5,26 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/fround --- <div>{{JSRef("Global_Objects", "Math")}}</div> -<h2 id="Summary" name="Summary">概述</h2> +<h2 id="Summary">概述</h2> <p><strong><code>Math.fround()</code></strong> 可以将任意的数字转换为离它最近的<a class="external" href="https://en.wikipedia.org/wiki/Single-precision_floating-point_format" title="link to the wikipedia page on single-precision floating-point format">单精度浮点数</a>形式的数字。</p> -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="brush: js"><code>Math.fround(<var>doubleFloat</var>)</code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>doubleFloat</code></dt> <dd>一个 {{jsxref("Number")}}。若参数为非数字类型,则会被转投成数字。无法转换时,设置成{{jsxref("NaN")}}。</dd> </dl> -<h3 id="Parameters" name="Parameters">返回值</h3> +<h3 id="Parameters">返回值</h3> <p>指定数字最接近的<a href="https://en.wikipedia.org/wiki/Single-precision_floating-point_format">32位单精度</a>浮点数表示。</p> -<h2 id="Examples" name="Examples">描述</h2> +<h2 id="Examples">描述</h2> <p>JavaScript 内部使用64位的双浮点数字,支持很高的精度。但是,有时你需要用32位浮点数字,比如你从一个{{jsxref("Float32Array")}} 读取值时。这时会产生混乱:检查一个64位浮点数和一个32位浮点数是否相等会失败,即使二个数字几乎一模一样。</p> @@ -32,7 +32,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/fround <p>因为<code>fround()</code> 是<code>Math</code> 的静态方法,你必须通过 <code>Math.fround()</code> 来使用,而不是调用你创建的<code>Math</code> 对象的一个实例方法(<code>Math</code>不是一个构造函数)。</p> -<h2 id="Examples" name="Examples">示例</h2> +<h2 id="Examples">示例</h2> <h3 id="使用_Math.fround()">使用 Math.fround()</h3> @@ -70,7 +70,7 @@ function equal(v1, v2) { equal(0.1 + 0.2, 0.3); //true </pre> -<h2 id="Polyfill" name="Polyfill">Polyfill</h2> +<h2 id="Polyfill">Polyfill</h2> <p>下面的函数可以模拟这个 API,前提是浏览器必须已经支持 {{jsxref("Float32Array")}}:</p> @@ -80,7 +80,7 @@ equal(0.1 + 0.2, 0.3); //true }; })(new Float32Array(1));</pre> -<h2 id="Specifications" name="Specifications">规范</h2> +<h2 id="Specifications">规范</h2> <table class="standard-table"> <tbody> @@ -95,7 +95,7 @@ equal(0.1 + 0.2, 0.3); //true </tbody> </table> -<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2> +<h2 id="Browser_compatibility">浏览器兼容性</h2> <div>{{CompatibilityTable}}</div> @@ -147,7 +147,7 @@ equal(0.1 + 0.2, 0.3); //true </table> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("Math.round()")}}</li> |
