<br><font size=2><tt>Jörg</tt></font><font size=2 face="sans-serif">,</font>
<br>
<br><font size=2 face="sans-serif">With formatType 1 CoinMpsIO::writeMps()
writes 18 digits of accuracy (well it does now).</font>
<br>
<br><font size=2 face="sans-serif">I have modified code to take out leading
zeros in exponent. &nbsp;That should work as numbers &gt; 1.0e40 are treated
differently with formaType 0 so there will always be at least one 0 on
Microsoft.</font>
<br>
<br><font size=2 face="sans-serif">John Forrest</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>&quot;Jörg Herbers&quot;
&lt;herbers@hotmail.com&gt;</b> </font>
<br><font size=1 face="sans-serif">Sent by: coin-discuss-admin@www-124.southbury.usf.ibm.com</font>
<p><font size=1 face="sans-serif">03/25/2004 10:11 AM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
coin-discuss</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">coin-discuss@www-124.southbury.usf.ibm.com</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">[Coin-discuss] Problem with
MPS export / MSVC</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>I encountered a problem when exporting an mps file
via CoinMpsIO. I work on <br>
Microsoft Visual Studio .NET 2003 which handles printf format specification
<br>
flags somewhat different from e.g. the gcc compiler. The problem is that
<br>
large &quot;infinity&quot; upper bounds are exported as &quot;2.147484e+00&quot;,
i.e. the <br>
exponent is 0. CoinMpsIO::writeMps() takes the minimum over the given upper
<br>
bound and INT_MAX (2147483647). convertDouble() converts this to a string,
<br>
using format specification &quot;%12.7g&quot;. The resulting string is
cut after 12 <br>
characters according to the MPS specification for the BOUNDS section. But
<br>
while gcc converts INT_MAX into 2.147484e+09, MS VC7 (and equally MS VC6)
<br>
converts it into 2.147484e+009, and the final &quot;9&quot; at position
12 will be cut <br>
afterwards. The Microsoft documentation says that the exponent will always
<br>
be typeset with three digits while gcc uses two digits for exponents &lt;100.
I <br>
don&#8217;t know if the C++ standard defines a &quot;correct&quot; behaviour.<br>
<br>
I have solved the problem in my COIN code, but I would clearly prefer a
<br>
general solution. Several ways are viable: On the one hand, the format
<br>
specifications could generally be changed to &quot;%12.6g&quot;. On the
other hand, <br>
there could be a specific solution for the Microsoft compiler, e.g. by
the <br>
above reduction of significant digits or by a manipulation of the resulting
<br>
string, e.g. by something like<br>
<br>
#if defined(_MSC_VER)<br>
 &nbsp; &nbsp;if ((outputValue[9] == '+') &amp;&amp; (outputValue[10] ==
'0'))<br>
 &nbsp; &nbsp; &nbsp;strcpy(&amp;(outputValue[10]), &amp;(outputValue[11]));<br>
#endif<br>
<br>
I would be very glad if you could integrate a fix into the code.<br>
<br>
Thanks a lot,<br>
Jörg<br>
<br>
_________________________________________________________________<br>
Help STOP SPAM with the new MSN 8 and get 2 months FREE* &nbsp;<br>
http://join.msn.com/?page=features/junkmail<br>
<br>
_______________________________________________<br>
Coin-discuss mailing list<br>
Coin-discuss@www-124.ibm.com<br>
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss<br>
</tt></font>
<br>