回答編集履歴
2
「負の数」を「正の数」に変換しない
test
CHANGED
@@ -26,11 +26,15 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
+
ビット演算子は内部的に **ToInt32** を使用していますが、「負の数」を「正の数」に変換しません(ToInt32 と動作が異なります)。
|
30
|
+
|
31
|
+
|
32
|
+
|
29
33
|
```JavaScript
|
30
34
|
|
31
|
-
n
|
35
|
+
console.log(-1.372 | 0); // -1
|
32
36
|
|
33
|
-
~~
|
37
|
+
console.log(~~-1.372); // -1
|
34
38
|
|
35
39
|
```
|
36
40
|
|
1
12.12.3 Runtime Semantics: Evaluation
test
CHANGED
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
- [12.12 Binary Bitwise Operators - ECMAScript® 2017 Language Specification](http://www.ecma-international.org/ecma-262/8.0/#sec-binary-bitwise-operators)
|
42
42
|
|
43
|
-
- [1
|
43
|
+
- [12.12.3 Runtime Semantics: Evaluation - ECMAScript® 2017 Language Specification](http://www.ecma-international.org/ecma-262/8.0/#sec-binary-bitwise-operators-runtime-semantics-evaluation)
|
44
44
|
|
45
45
|
|
46
46
|
|