<div class="gmail_quote">On Thu, Jun 26, 2008 at 8:55 PM, &quot;Martin v. Löwis&quot; &lt;<a href="mailto:martin@v.loewis.de">martin@v.loewis.de</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"><br>
</div>I think the feature is misguided in the first place. Why do you want<br>
a hex representation of floating point numbers? </blockquote><div><br></div><div>Answering for myself: &nbsp;because it gives an exact representation of a</div><div>floating-point number in a fairly human-readable format.</div>
<div>&nbsp;<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Can&#39;t you use&nbsp;struct.pack for that?</blockquote><div><br></div><div>struct.pack would only show the bit layout, leaving the user to</div>
<div>manually extract the sign bit, exponent, and fraction, and then make</div><div>sense&nbsp;of the whole thing. &nbsp;The proposed feature works at a higher</div><div>level of abstraction, directly describing the *value* of the float rather</div>
<div>than its bit layout. &nbsp;In particular, this means it&#39;ll make sense</div><div>across platforms, regardless of variations in bit layout.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
And, if bin/hex/oct are useful, why not base<br>
6 (say)?<br></blockquote><div><br></div><div>I&#39;d say that bin and hex are special: &nbsp;bin is natural because</div><div>floats are usually thought of, and stored as, binary numbers.</div><div>hex is special because it gives&nbsp;a compact way of representing</div>
<div>a float, and because there&#39;s&nbsp;already a history of using hex</div><div>floats in numerical analysis&nbsp;literature and in programming</div><div>languages (C99, Java, ...)</div><div><br></div><div>I have to admit that I can&#39;t see much use for octal floats.</div>
<div><br></div><div>Mark</div><div><br></div></div>