回答編集履歴

1

追記

2018/11/04 10:03

投稿

LouiS0616
LouiS0616

スコア35660

test CHANGED
@@ -15,3 +15,23 @@
15
15
  cout << labs(static_cast<long>(a - b)) << endl;
16
16
 
17
17
  ```
18
+
19
+
20
+
21
+ 追記
22
+
23
+ ---
24
+
25
+ 規格書を見る限り、実装依存であるようです。
26
+
27
+ > **Integral conversions**
28
+
29
+ ...
30
+
31
+ If the destination type is signed, the value is unchanged if it can be represented in the destination type;
32
+
33
+ otherwise, the value is implementation-defined.
34
+
35
+
36
+
37
+ 引用元: N4659 [conv.integral]