On Thu, Jun 26, 2008 at 9:28 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote:

> Can you show us what APIs and output formats C99 and Java support?
> Maybe we can borrow something from there rather than reinventing the
> wheel?
>

Java's toHexString method is documented at:

http://java.sun.com/javase/6/docs/api/java/lang/Double.html#toHexString(double)

It's disadvantage from Python's point of view is that some features are IEEE
754
specific (e.g. treatment of subnormals, which don't exist for most other
floating
point types).

C99s support for hex literals uses a similar format;  the standard is less
specific about the precise output format, but it's still of the form

0x1.<fraction>p<exponent>

Incidentally, the funny 'p' for the exponent instead of 'e' is apparently
there to avoid ambiguity in something like:

0x1e+3

Mark
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to