Printing floating points

deadalnix deadalnix at gmail.com
Thu Jan 21 14:02:52 UTC 2021


https://forum.dlang.org/post/r1hsv2$tt0$1@digitalmars.com

On Thursday, 6 February 2020 at 20:29:31 UTC, Walter Bright wrote:
> This one is always going to be a tough one:
>
> https://github.com/dlang/phobos/pull/7264
>
> Floating point code is extremely difficult to get right, and 
> contains a lot of very subtle traps for the unwary. (It's why 
> people are still writing research papers on formatting floating 
> point numbers.) If there's a mistake in it that subtly breaks 
> someone's floating point code, it would cause them to not trust 
> D. Just finding someone capable of reviewing it thoroughly 
> would be very difficult for any community.
>

While we are on this, I should point out that there has been a 
major breakthrough on the matter fairly recently called ryu.

I invite everyone who has an interest in printing floating to 
look at it. Here are a few useful links:

The original paper: 
https://dl.acm.org/doi/pdf/10.1145/3296979.3192369
Another paper: https://dl.acm.org/doi/pdf/10.1145/3360595

Source code in various languages: https://github.com/ulfjack/ryu



More information about the Digitalmars-d mailing list