From 3bb96c83e22a7a6214e79e9b903ee1c7b5657e67 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:08 +0800 Subject: adjust dl/dt/dd tags for zh-TW --- .../equality_comparisons_and_sameness/index.html | 50 ++++++++-------------- 1 file changed, 19 insertions(+), 31 deletions(-) (limited to 'files/zh-tw/web/javascript/equality_comparisons_and_sameness/index.html') diff --git a/files/zh-tw/web/javascript/equality_comparisons_and_sameness/index.html b/files/zh-tw/web/javascript/equality_comparisons_and_sameness/index.html index ca2ce26b9a..1a5459883f 100644 --- a/files/zh-tw/web/javascript/equality_comparisons_and_sameness/index.html +++ b/files/zh-tw/web/javascript/equality_comparisons_and_sameness/index.html @@ -379,9 +379,6 @@ function attemptMutation(v)
- (unary negation)
-
- -

It's obvious that negating 0 produces -0. But the abstraction of an expression can cause -0 to creep in when you don't realize it. For example, consider:

@@ -389,36 +386,27 @@ function attemptMutation(v)

If obj.velocity is 0 (or computes to 0), a -0 is introduced at that place and propogates out into stoppingForce.

-
- -
-
Math.atan2
-
Math.ceil
-
Math.pow
-
Math.round
-
- -
+
+ Math.atan2, + Math.ceil, + Math.pow, + Math.round +
It's possible for a -0 to be introduced into an expression as a return value of these methods in some cases, even when no -0 exists as one of the parameters. E.g., using Math.pow to raise -Infinity to the power of any negative, odd exponent evaluates to -0. Refer to the documentation for the individual methods.
-
- -
-
Math.floor
-
Math.max
-
Math.min
-
Math.sin
-
Math.sqrt
-
Math.tan
-
- -
+
+ Math.floor, + Math.max, + Math.min, + Math.sin, + Math.sqrt, + Math.tan +
It's possible to get a -0 return value out of these methods in some cases where a -0 exists as one of the parameters. E.g., Math.min(-0, +0) evalutes to -0. Refer to the documentation for the individual methods.
-
- -
-
~
-
<<
-
>>
+
+ ~, + <<, + >> +
Each of these operators uses the ToInt32 algorithm internally. Since there is only one representation for 0 in the internal 32-bit integer type, -0 will not survive a round trip after an inverse operation. E.g., both Object.is(~~(-0), -0) and Object.is(-0 << 2 >> 2, -0) evaluate to false.
-- cgit v1.2.3-54-g00ecf