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/bigint/index.html | 31 ++++++---------------- 1 file changed, 8 insertions(+), 23 deletions(-) (limited to 'files/zh-tw/web/javascript/reference/global_objects/bigint') diff --git a/files/zh-tw/web/javascript/reference/global_objects/bigint/index.html b/files/zh-tw/web/javascript/reference/global_objects/bigint/index.html index 35ccd60a0b..2e62e69184 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/bigint/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/bigint/index.html @@ -19,8 +19,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/BigInt
欲創建的數值,可以為整數或字串。
-
-

Note: BigInt() 不和 {{JSxRef("Operators/new", "new")}} 一起使用。

+
+

Note: BigInt() 不和 {{JSxRef("Operators/new", "new")}} 一起使用。

@@ -47,8 +47,8 @@ const hugeBin = BigInt("0b11111111111111111111111111111111111111111111111111111"

BigInt 跟 {{JSxRef("Number")}} 很像,但在某些部分有些許不同 — 它不可以被用在內建的 {{JSxRef("Math")}} 物件方法中、而且不可以跟 Number 的實體混用運算子。

-
-

{{JSxRef("Number")}} 和 BigInt 不能混和計算 — 他們必須被轉換到同一個型態。

+
+

警告: {{JSxRef("Number")}} 和 BigInt 不能混和計算 — 他們必須被轉換到同一個型態。

然而,在相互轉換時要注意, BigInt 在被轉換成 Number 時可能會遺失部分精度的資訊。

@@ -97,8 +97,8 @@ bigN * -1n

/ 運算子也同樣的能夠運行。然而,因為型態是 BigInt 而不是 BigDecimal ,除法運算會無條件捨去小數。也就是說,回傳值不會包含小數部分。

-
-

回傳值帶小數的運算在使用BigInt  時小數部分會被捨去。

+
+

警告:回傳值帶小數的運算在使用BigInt 時小數部分會被捨去。

const expected = 4n / 2n;
@@ -251,26 +251,11 @@ nthPrime(20n)
 
 

規範

- - - - - - - - - - - -
規範狀態
BigIntStage 3
+{{Specifications}}

瀏覽器相容性

-
- - -

{{Compat("javascript.builtins.BigInt")}}

-
+{{Compat}}

另見

-- cgit v1.2.3-54-g00ecf