Dear all

This is my very first email to python-ideas, and I strongly support this idea.
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 :

The support for hexadecimal formatting was introduced in C99 with the '%a' formatter for string formatting (see page 57-58 for literals, or, and, it would be great if python could support it.



The support of hexadecimal floating literals (like 0xC.68p+2) is included in just released C++17 standard. Seems this becomes a mainstream.

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}')?

Python-ideas mailing list
Code of Conduct:

                               Dr Thibault HILAIRE

Université Pierre et Marie Curie (Associate Professor)
Computing Science Lab (LIP6)
Engineering school Polytech Paris UPMC

4 place Jussieu
75005 PARIS, France

tel: +33 (0)