aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/javascript/reference/global_objects/math/random/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-tw/web/javascript/reference/global_objects/math/random/index.html')
-rw-r--r--files/zh-tw/web/javascript/reference/global_objects/math/random/index.html10
1 files changed, 5 insertions, 5 deletions
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 1613c18777..896d4ab948 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
@@ -18,7 +18,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random
<h2 id="語法">語法</h2>
-<pre class="syntaxbox notranslate">Math.random()</pre>
+<pre class="syntaxbox">Math.random()</pre>
<h3 id="回傳值_Return_value">回傳值 Return value</h3>
@@ -30,7 +30,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random
<h3 id="Getting_a_random_number_between_0_inclusive_and_1_exclusive">Getting a random number between 0 (inclusive) and 1 (exclusive)</h3>
-<pre class="brush: js notranslate">function getRandom() {
+<pre class="brush: js">function getRandom() {
return Math.random();
}
</pre>
@@ -39,7 +39,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random
<p>This example returns a random number between the specified values. The returned value is no lower than (and may possibly equal) <code>min</code>, and is less than (and not equal) <code>max</code>.</p>
-<pre class="brush: js notranslate">function getRandomArbitrary(min, max) {
+<pre class="brush: js">function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
}
</pre>
@@ -48,7 +48,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random
<p>This example returns a random <em>integer</em> between the specified values. The value is no lower than <code>min</code> (or the next integer greater than <code>min</code> if <code>min</code> isn't an integer), and is less than (but not equal to) <code>max</code>.</p>
-<pre class="brush: js notranslate">function getRandomInt(min, max) {
+<pre class="brush: js">function getRandomInt(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
@@ -63,7 +63,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random
<p>While the <code>getRandomInt()</code> function above is inclusive at the minimum, it's exclusive at the maximum. What if you need the results to be inclusive at both the minimum and the maximum? The <code>getRandomIntInclusive()</code> function below accomplishes that.</p>
-<pre class="brush: js notranslate">function getRandomIntInclusive(min, max) {
+<pre class="brush: js">function getRandomIntInclusive(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1) + min); //The maximum is inclusive and the minimum is inclusive