<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Dear all<div><br></div><div>This is my very first email to python-ideas, and I strongly support this idea.</div><div>float.hex() does the job for float to hexadecimal conversion, and float.fromhex() does the opposite. But a full support for hexadecimal floating-point literals would be great (it bypasses the decimal to floating-point conversion), as explained for general purpose here : <a href="http://www.exploringbinary.com/hexadecimal-floating-point-constants/">http://www.exploringbinary.com/hexadecimal-floating-point-constants/</a></div><div><br></div><div>The support for hexadecimal formatting was introduced in C99 with the '%a' formatter for string formatting (see <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf</a> page 57-58 for literals, or <a href="http://en.cppreference.com/w/cpp/language/floating_literal">http://en.cppreference.com/w/cpp/language/floating_literal</a>), and, it would be great if python could support it.</div><div><br></div><div>Thanks</div><div><br></div><div>Thibault </div><div><div><div><br></div><br class="Apple-interchange-newline"><blockquote type="cite">The support of hexadecimal floating literals (like 0xC.68p+2) is included in just released C++17 standard. Seems this becomes a mainstream.<br><br>In Python float.hex() returns hexadecimal string representation. Is it a time to add more support of hexadecimal floating literals? Accept them in float constructor and in Python parser? And maybe add support of hexadecimal formatting ('%x' and '{:x}')?<br><br>_______________________________________________<br>Python-ideas mailing list<br><a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>https://mail.python.org/mailman/listinfo/python-ideas<br>Code of Conduct: http://python.org/psf/codeofconduct/<br></blockquote></div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">___________________________________________________<br>                               Dr Thibault HILAIRE<br><br>Université Pierre et Marie Curie (Associate Professor)<br>Computing Science Lab (LIP6)</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Engineering school Polytech Paris UPMC</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br>4 place Jussieu<br>75005 PARIS, France<br><br>tel: +33 (0)1.44.27.87.73<br>email: <a href="mailto:thibault.hilaire@lip6.fr">thibault.hilaire@lip6.fr</a><br>web: <a href="http://www.docmatic.fr">http://www.docmatic.fr</a></div></div></div>
</div>

<br></div></body></html>