回答編集履歴
2
9.789999999999999への加算追記
test
CHANGED
@@ -24,7 +24,15 @@
|
|
24
24
|
|
25
25
|
cpp_dec_float_50 C = B + cpp_dec_float_50("0.005");
|
26
26
|
|
27
|
+
std::cout << std::fixed << std::setprecision(15) << B << std::endl;
|
27
28
|
|
29
|
+
std::cout << std::fixed << std::setprecision(15) << C << std::endl;
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
B = cpp_dec_float_50("9.789999999999999");
|
34
|
+
|
35
|
+
C = B + cpp_dec_float_50("0.005");
|
28
36
|
|
29
37
|
std::cout << std::fixed << std::setprecision(15) << B << std::endl;
|
30
38
|
|
@@ -46,4 +54,8 @@
|
|
46
54
|
|
47
55
|
9.795000000000000
|
48
56
|
|
57
|
+
9.789999999999999
|
58
|
+
|
59
|
+
9.794999999999999
|
60
|
+
|
49
61
|
```
|
1
コード変更
test
CHANGED
@@ -14,15 +14,15 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
n
|
17
|
+
using boost::multiprecision::cpp_dec_float_50;
|
18
18
|
|
19
19
|
int main()
|
20
20
|
|
21
21
|
{
|
22
22
|
|
23
|
-
|
23
|
+
cpp_dec_float_50 B("9.79");
|
24
24
|
|
25
|
-
|
25
|
+
cpp_dec_float_50 C = B + cpp_dec_float_50("0.005");
|
26
26
|
|
27
27
|
|
28
28
|
|