Originally posted by: SystemAdmin
Tobias is most probably correct. Since you use C++ I assume you are using operator<< to output the floating point value. The default number of digits after the decimal point for this operator is 6. The following example shows you how to change that:
#include <iostream>
int
main(void)
{
double num = 0.456728911;
std::cout << num << std::endl;
std::streamsize old = std::cout.precision(20);
std::cout << num << std::endl;
std::cout.precision(old);
return 0;
}
The second time the code prints 'num' it will print it with 20 digits after the point.
There is one more thing to keep in mind here: Not every rational number can be represented exactly as a double precision floating point number. This means that the number that the compiler generates for '0.456728911' may be slightly different from 0.456728911 as it picks the closest number that can be represented as double precision floating point number. For example, my machine prints 0.45672891100000001519 in the second line. There is nothing you can do about that.
#CPLEXOptimizers#DecisionOptimization