<div class="gmail_quote">On Thu, Jun 26, 2008 at 9:28 PM, Guido van Rossum &lt;<a href="mailto:guido@python.org">guido@python.org</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d">Can you show us what APIs and output formats C99 and Java support?<br></div>
Maybe we can borrow something from there rather than reinventing the<br>
wheel?<br>
<div><div></div><div class="Wj3C7c"></div></div></blockquote><div><br></div><div>Java&#39;s toHexString method is documented at:</div><div><br></div><div><a href="http://java.sun.com/javase/6/docs/api/java/lang/Double.html#toHexString(double)">http://java.sun.com/javase/6/docs/api/java/lang/Double.html#toHexString(double)</a><br>
</div><div><br></div><div>It&#39;s disadvantage from Python&#39;s point of view is that some features are IEEE 754</div><div>specific (e.g. treatment of subnormals, which don&#39;t exist for most other floating</div><div>
point types).</div><div><br></div><div>C99s support for hex literals uses a similar format; &nbsp;the standard is less</div><div>specific about the precise output format, but it&#39;s still of the form</div><div><br></div><div>
0x1.&lt;fraction&gt;p&lt;exponent&gt;</div><div><br></div><div>Incidentally, the funny &#39;p&#39; for the exponent instead of &#39;e&#39; is apparently</div><div>there to avoid ambiguity in something like:</div><div><br>
</div><div>0x1e+3</div><div><br></div><div>Mark</div></div>