diff options
Diffstat (limited to 'files/zh-tw/web/javascript/reference/global_objects/math')
3 files changed, 14 insertions, 92 deletions
diff --git a/files/zh-tw/web/javascript/reference/global_objects/math/index.html b/files/zh-tw/web/javascript/reference/global_objects/math/index.html index 2b09b4de23..b200a53959 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/math/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/math/index.html @@ -40,12 +40,12 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math <h2 id="方法">方法</h2> -<div class="note"> -<p>注意三角函數 (<code>sin()</code>, <code>cos()</code>, <code>tan()</code>, <code>asin()</code>, <code>acos()</code>, <code>atan()</code>, <code>atan2()</code>) 的參數或回傳值的角度皆以弧度為單位。把角度乘上 <code>(Math.PI / 180)</code> 會得到弧度單位,將弧度除以該數則會轉換回一般所用的角度單位。</p> +<div class="notecard note"> +<p><strong>備註:</strong>三角函數 (<code>sin()</code>, <code>cos()</code>, <code>tan()</code>, <code>asin()</code>, <code>acos()</code>, <code>atan()</code>, <code>atan2()</code>) 的參數或回傳值的角度皆以弧度為單位。把角度乘上 <code>(Math.PI / 180)</code> 會得到弧度單位,將弧度除以該數則會轉換回一般所用的角度單位。</p> </div> -<div class="note"> -<p>注意許多數學方法的精度是取決於實作方式的。這意味著不同的瀏覽器可能會得到不同的結果,甚至同一個 JS引擎在不同的作業系統或架構上所得到的結果都有可能相異。</p> +<div class="notecard note"> +<p><strong>備註:</strong>許多數學方法的精度是取決於實作方式的。這意味著不同的瀏覽器可能會得到不同的結果,甚至同一個 JS引擎在不同的作業系統或架構上所得到的結果都有可能相異。</p> </div> <dl> diff --git a/files/zh-tw/web/javascript/reference/global_objects/math/random/index.html b/files/zh-tw/web/javascript/reference/global_objects/math/random/index.html index 6731d1c2b4..8087d30bfd 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/math/random/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/math/random/index.html @@ -10,8 +10,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random <p>函數 <strong><code>Math.random()</code></strong> 會回傳一個偽隨機小數 (pseudo-random) 介於0到1之間(包含 0,不包含1) ,大致符合數學與統計上的均勻分佈 (uniform distribution) ,您可以選定想要的數字區間,它會透過演算法被產生並且不允許使用者自行跳選或重設成特定數字。{{EmbedInteractiveExample("pages/js/math-random.html")}}</p> -<div class="note"> -<p><code>Math.random()</code> 所產生的偽隨機小數不符合加密學安全性要求。<em>請勿使用於任何加密、資安相關領域。</em></p> +<div class="notecard note"> +<p><strong>備註:</strong><code>Math.random()</code> 所產生的偽隨機小數不符合加密學安全性要求。<em>請勿使用於任何加密、資安相關領域。</em></p> <p><em>如有加密需求建議參考Web Crypto API</em><a href="/en-US/docs/Web/API/RandomSource/getRandomValues" title="The documentation about this has not yet been written; please consider contributing!"><code>window.crypto.getRandomValues()</code></a></p> </div> @@ -55,8 +55,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random } </pre> -<div class="note"> -<p>It might be tempting to use <code>Math.round()</code> to accomplish that, but doing so would cause your random numbers to follow a non-uniform distribution, which may not be acceptable for your needs.</p> +<div class="notecard note"> +<p><strong>Note:</strong> might be tempting to use <code>Math.round()</code> to accomplish that, but doing so would cause your random numbers to follow a non-uniform distribution, which may not be acceptable for your needs.</p> </div> <h3 id="Getting_a_random_integer_between_two_values_inclusive">Getting a random integer between two values, inclusive</h3> @@ -69,24 +69,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random return Math.floor(Math.random() * (max - min + 1) + min); //The maximum is inclusive and the minimum is inclusive }</pre> -<h2 id="Specifications">Specifications</h2> +<h2 id="規範">規範</h2> -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specification</th> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-math.random', 'Math.random')}}</td> - </tr> - </tbody> -</table> +{{Specifications}} <h2 id="瀏覽器相容性">瀏覽器相容性</h2> -<p>{{Compat("javascript.builtins.Math.random")}}</p> +{{Compat}} -<h2 class="countTop" id="其他參考資料">其他參考資料</h2> +<h2 id="其他參考資料">其他參考資料</h2> <ul> <li><a href="/en-US/docs/Web/API/RandomSource/getRandomValues" title="The documentation about this has not yet been written; please consider contributing!"><code>window.crypto.getRandomValues()</code></a></li> diff --git a/files/zh-tw/web/javascript/reference/global_objects/math/round/index.html b/files/zh-tw/web/javascript/reference/global_objects/math/round/index.html index efde660a66..8b37f8b851 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/math/round/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/math/round/index.html @@ -126,80 +126,11 @@ Math.ceil10(-59, 1); // -50 <h2 id="規範">規範</h2> -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">規範</th> - <th scope="col">狀態</th> - <th scope="col">註</th> - </tr> - <tr> - <td>{{SpecName('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>Initial definition. Implemented in JavaScript 1.0.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.8.2.15', 'Math.round')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-math.round', 'Math.round')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - </tbody> -</table> +{{Specifications}} <h2 id="瀏覽器相容性">瀏覽器相容性</h2> -<div>{{CompatibilityTable}}</div> - -<div> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari (WebKit)</th> - </tr> - <tr> - <td>Basic support</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<div> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Phone</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Basic support</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> +{{Compat}} <h2 id="參見">參見</h2> |