Input data i data file vs printed input data in output file

Hi,

I’m using AMPL with CPLEX on a server, and as part of the output file, I’ve setup the runfile such that the input data (parameters/sets) is also printed in the output file (.out). However, there are some differences in the values shown in the .out file contra .dat file, some are rounding effect, but some are strange and hard to categorize under rounding effect. For instance, a parameter with value “2260008.75” is printed out in .out as “2260010” or “3013345” in .dat is printed as “3013340”.
I’m not quite sure where the problem can be and how to fix it; in other words, I’m not sure which value it is the AMPL/CPLEX is using to slove the model, the one in .dat (as expected) or the one shown in .out. While the differences are not huge, but that makes the results a bit uncertain as well given the observed circumstances of input data.

Any thoughts or suggestions?

The default setting for the AMPL display command is to show numbers to 6 significant digits. Thus values with more than 6 significant digits are rounded to the first 6: 2260008.75 becomes 2260010, and 3013345 becomes 3013340.

You can use AMPL’s display_precision to specify a different number of significant digits. For example, option display_precision 10; will cause display to show the above examples as you expect. For more information about this and other display-related options, see our section on Display Command Options in the AMPL Options Guide.