Stephan T. Lavavej

Results 353 comments of Stephan T. Lavavej
trafficstars

This was my optimization and it was intentionally written as a single test instead of a loop. For random doubles, typically the “remove two digits” optimization can be applied exactly...

I can't recall if I tried the approach of looping for 2 and testing for 1. I can profile again. I know that it helps short outputs (many digits to...

Note that Ryu is inherently incapable of emitting arbitrary precision. You could modify the algorithm to emit additional digits in scientific or fixed notation, but after running out of the...

I have code for fixed notation and I should have time to polish it up and submit a pull request in October.

Here's the fixed notation code that I wrote for VS 2017 15.9 (slightly revised): https://github.com/StephanTLavavej/ryu/blob/msvc-2018.10.22/ryu/d2s.c#L388 It isn't ready for a pull request yet. Outstanding issues: * Mechanical: I wrote this...

I benchmarked my `to_chars()` implementation powered by Ryu (which differs from upstream in that it's bounds-checked, follows `sprintf()` conventions for exponent style, and pays additional overhead for `chars_format` and centralized...

Data point: charconv's shortest fixed notation overload benefits from calling `d2fixed_buffered_n()` for large exactly-representable integer doubles, but not for floats. On x86, the long division technique on `uint32_t[4]` is significantly...

1. Should commit https://github.com/ulfjack/ryu/commit/159ce150fa94e0229f3e02ecc6f4243f21388c0b have updated the comment immediately above, https://github.com/ulfjack/ryu/blob/159ce150fa94e0229f3e02ecc6f4243f21388c0b/ryu/d2s.c#L309-L315 which mentions `q - 1` repeatedly? 2. Should f2s.c's analogous code, https://github.com/ulfjack/ryu/blob/159ce150fa94e0229f3e02ecc6f4243f21388c0b/ryu/f2s.c#L231-L232 be changed accordingly? (Apologies if this question...

The necessary changes for `to_chars` are significant - I've been working on floating-point `to_chars` for almost a year (shortly after adding `from_chars` on May 23, 2018). You can see my...

> Are you suggesting that Boost should build an implementation on top of std::to_chars which requires C++17? Yeah. With to_chars possibly being provided as a "bolt-on" standalone implementation. I'd like...