Replacement for snprintf

berni44 dlang at d-ecke.de
Thu Oct 31 21:30:47 UTC 2019


On Thursday, 31 October 2019 at 01:09:14 UTC, Walter Bright wrote:
> To that end, you'll need to be familiar with the following:

Thanks for that list. I'll have a look, when I find the time to 
do so.

> 754-2019 IEEE Standard for Floating Point Arithmetic
> https://ieeexplore.ieee.org/document/8766229

Unfortunately I cannot download this file. I've got no company 
listed there and I'm not willing to pay for it...

> Ryu Fast Float To String Conversion
> https://dl.acm.org/citation.cfm?id=3192369
>
> https://github.com/ulfjack/ryu
> [...]
>
> Jonathan Marler's D implementation of ryu:
> https://github.com/dragon-lang/mar/blob/master/src/mar/ryu.d

I allready read the paper about ryu. IMHO it's of no use here, 
because the speed advantage comes from being more "inaccurate" 
than snprintf. Ryu is designed for a round-trip, while snprintf 
prints as many digits, as the user wants to get (even when they 
contain no more information). The same holds for grisu variants.



More information about the Digitalmars-d mailing list