Thread overview
[Issue 3248] lossless floating point formatting
Nov 04, 2014
yebblies
Apr 16
Ben
September 19, 2014
https://issues.dlang.org/show_bug.cgi?id=3248

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx

--- Comment #13 from hsteoh@quickfur.ath.cx ---
Wouldn't the most lossless format be to just dump the representation in hexadecimal (i.e., in the same format as a hexadecimal float literal)? That way you're guaranteed that you don't get excess precision where there is none, nor do you lose any bits.

--
November 04, 2014
https://issues.dlang.org/show_bug.cgi?id=3248

yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies@gmail.com

--- Comment #14 from yebblies <yebblies@gmail.com> ---
(In reply to hsteoh from comment #13)
> Wouldn't the most lossless format be to just dump the representation in hexadecimal (i.e., in the same format as a hexadecimal float literal)? That way you're guaranteed that you don't get excess precision where there is none, nor do you lose any bits.

That would no longer be human-readable.

--
June 09, 2015
https://issues.dlang.org/show_bug.cgi?id=3248

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unspecified                 |D2

--
September 07, 2015
https://issues.dlang.org/show_bug.cgi?id=3248

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|hsteoh@quickfur.ath.cx      |

--
November 03, 2015
https://issues.dlang.org/show_bug.cgi?id=3248

--- Comment #15 from Andrei Alexandrescu <andrei@erdani.com> ---
Anyone working on this?

--
April 16
https://issues.dlang.org/show_bug.cgi?id=3248

Ben <ben.james.jones@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ben.james.jones@gmail.com

--- Comment #16 from Ben <ben.james.jones@gmail.com> ---
I'd be interested in taking a stab at this based on the new algorithm presented here: https://dl.acm.org/citation.cfm?id=3192369 .  STL (the person) has been tweeting about adding this to the MS STL (the library) implementation for char_conv in C++ 17(?) and it sounds like a big speed win in addition to having nice round trip properties.  Currently formatValueImpl seems to just call snprintf.

--
April 16
https://issues.dlang.org/show_bug.cgi?id=3248

Stefan Koch <uplink.coder@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uplink.coder@gmail.com

--- Comment #17 from Stefan Koch <uplink.coder@gmail.com> ---
@Ben I already have a ctfeable implementation which is lossless for doubles. I am going to push it to druntime soon

--