| 1 | #include <boost/property_tree/ptree.hpp>
|
|---|
| 2 | #include <iostream>
|
|---|
| 3 | #include <iomanip>
|
|---|
| 4 |
|
|---|
| 5 | using namespace boost::property_tree;
|
|---|
| 6 | using namespace std;
|
|---|
| 7 |
|
|---|
| 8 | int
|
|---|
| 9 | main (void)
|
|---|
| 10 | {
|
|---|
| 11 | double in = -183.12345000098765e-10;
|
|---|
| 12 | double out;
|
|---|
| 13 |
|
|---|
| 14 | ptree pt;
|
|---|
| 15 | pt.put("num", in);
|
|---|
| 16 | out = pt.get<double>("num");
|
|---|
| 17 |
|
|---|
| 18 | cout << "in : " << setprecision(17) << in << "\n";
|
|---|
| 19 | cout << "out: " << setprecision(17) << out << "\n";
|
|---|
| 20 | if ((in < out) || (in > out))
|
|---|
| 21 | cout << "Wrong\n";
|
|---|
| 22 | else
|
|---|
| 23 | cout << "Right\n";
|
|---|
| 24 |
|
|---|
| 25 | return 0;
|
|---|
| 26 | }
|
|---|