From f45e9e070c93ebbd83d488bdd775987a4d75c201 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:08 +0800 Subject: fix yari h2m dry run errors --- .../reference/global_objects/math/index.html | 8 +-- .../global_objects/math/random/index.html | 25 +++----- .../reference/global_objects/math/round/index.html | 73 +--------------------- 3 files changed, 14 insertions(+), 92 deletions(-) (limited to 'files/zh-tw/web/javascript/reference/global_objects/math') 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

方法

-
-

注意三角函數 (sin(), cos(), tan(), asin(), acos(), atan(), atan2()) 的參數或回傳值的角度皆以弧度為單位。把角度乘上 (Math.PI / 180) 會得到弧度單位,將弧度除以該數則會轉換回一般所用的角度單位。

+
+

備註:三角函數 (sin(), cos(), tan(), asin(), acos(), atan(), atan2()) 的參數或回傳值的角度皆以弧度為單位。把角度乘上 (Math.PI / 180) 會得到弧度單位,將弧度除以該數則會轉換回一般所用的角度單位。

-
-

注意許多數學方法的精度是取決於實作方式的。這意味著不同的瀏覽器可能會得到不同的結果,甚至同一個 JS引擎在不同的作業系統或架構上所得到的結果都有可能相異。

+
+

備註:許多數學方法的精度是取決於實作方式的。這意味著不同的瀏覽器可能會得到不同的結果,甚至同一個 JS引擎在不同的作業系統或架構上所得到的結果都有可能相異。

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

函數 Math.random() 會回傳一個偽隨機小數 (pseudo-random) 介於0到1之間(包含 0,不包含1) ,大致符合數學與統計上的均勻分佈 (uniform distribution) ,您可以選定想要的數字區間,它會透過演算法被產生並且不允許使用者自行跳選或重設成特定數字。{{EmbedInteractiveExample("pages/js/math-random.html")}}

-
-

Math.random() 所產生的偽隨機小數不符合加密學安全性要求。請勿使用於任何加密、資安相關領域。

+
+

備註:Math.random() 所產生的偽隨機小數不符合加密學安全性要求。請勿使用於任何加密、資安相關領域。

如有加密需求建議參考Web Crypto APIwindow.crypto.getRandomValues()

@@ -55,8 +55,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random } -
-

It might be tempting to use Math.round() 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.

+
+

Note: might be tempting to use Math.round() 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.

Getting a random integer between two values, inclusive

@@ -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 } -

Specifications

+

規範

- - - - - - - - - -
Specification
{{SpecName('ESDraft', '#sec-math.random', 'Math.random')}}
+{{Specifications}}

瀏覽器相容性

-

{{Compat("javascript.builtins.Math.random")}}

+{{Compat}} -

其他參考資料

+

其他參考資料

  • window.crypto.getRandomValues()
  • 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

    規範

    - - - - - - - - - - - - - - - - - - - - - - - -
    規範狀態
    {{SpecName('ES1')}}{{Spec2('ES1')}}Initial definition. Implemented in JavaScript 1.0.
    {{SpecName('ES5.1', '#sec-15.8.2.15', 'Math.round')}}{{Spec2('ES5.1')}} 
    {{SpecName('ES6', '#sec-math.round', 'Math.round')}}{{Spec2('ES6')}} 
    +{{Specifications}}

    瀏覽器相容性

    -
    {{CompatibilityTable}}
    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
    Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
    Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    +{{Compat}}

    參見

    -- cgit v1.2.3-54-g00ecf