3 ms·
I'm so happy to hear you're interested in this problem. There's two packages in the Cosmo repo you could depend on for doing this: third_party/double-conversion
by jart 3y ago
I'm so happy to hear you're interested in this problem. There's two packages in the Cosmo repo you could depend on for doing this: third_party/double-conversion/ and third_party/gdtoa/. Both libraries are pretty good, but I think double-conversion is the more impressive of the two. It'd be great to see scanf() parse floats with double-conversion if it's possible. One last thing, if any of the non-standardized features of our scanf() implementation get in your way, then I'm not super attached to them and they can be deleted.
- matheusmoreira 3y agoI see. I'll try those libraries out. Was about to try writing my own algorithm despite not having a math background. The libraries will definitely be easier. Cosmopolitan can actually link against those despite being the libc? I'm building my copy of cosmopolitan right now. If I succeed, I'll send you a pull request on GitHub.
- matheusmoreira 3y agoPull request sent. https://github.com/jart/cosmopolitan/pull/924 https://github.com/jart/cosmopolitan/pull/924 Oops, I only now realized there's a test suite. I'll be adding tests too... After I get some sleep.