News for hackers. Stuff that matters.
Re:Parsing floats in C++: benchmarking strtod vs. from_chars by Someone on Thursday September 10, 2020 @05:36PM (#24436804)
…that doesn’t handle some edge cases (NaNs, infinities, denormalized numbers), or doesn’t round trip what to_chars produces for some values.

Parsing floating point strings, always producing the IEEE float or double closest to the number given, is surprisingly hard.

Re:Parsing floats in C++: benchmarking strtod vs. from_chars by titzer on Thursday September 10, 2020 @08:57PM (#24438153)
NaNs and infinities are not the hard cases.

The hard cases are big exponents and large numbers of decimal digits. In general, it requires arbitrarily large integers (OK, OK, up to the maximum size of a double ~2^1023) and long division on said large integers. Denormalized is a pain for sure.

Did this recently. https://github.com/titzer/virgil/blob/master/aeneas/src/vst/...