Ticket #10188: test.cpp

File test.cpp, 499 bytes (added by Magne OEstlyngen <magne+boost@…>, 8 years ago)

Test-case showing the problem

Line 
1#include <boost/property_tree/ptree.hpp>
2#include <iostream>
3#include <iomanip>
4
5using namespace boost::property_tree;
6using namespace std;
7
8int
9main (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}