Initializing help system before first use

XPRBsetrealfmt

XPRBsetrealfmt


Purpose
Set the format for printing real numbers.
Synopsis
int XPRBsetrealfmt(XPRBprob prob, const char *fmt);
Arguments
prob 
Reference to a problem.
fmt 
Format string (as used by the C function printf). Simple format strings are of the form %n where n may be, for instance, one of
default printing format (precision: 6 digits; exponential notation if the exponent resulting from the conversion is less than -4 or greater than or equal to the precision)
.numf 
print real numbers in the style [-]d.d where the number of digits after the decimal point is equal to the given precision num.
Return value
0 if function executed successfully, 1 otherwise.
Example
This example sets the number printing format to 10 digits after the decimal point:
XPRBprob expl2;
expl2 = XPRBnewprob("example2");
XPRBsetrealfmt(expl2, "%.10f");
Further information
1. In problems with very large or very small numbers it may become necessary to change the printing format to obtain a more exact output. In particular, by changing the precision it is possible to reduce the difference between matrices loaded in memory into Xpress Optimizer and the output produced by exporting them to a file.
2. This function can be used before any problem has been created (with first argument NULL). In this case the setting applies to all problems that are created subsequently.
Related topics