Add optimized (smaller) lookup table for float type parsing
Reduce code size if only float accuracy is needed for parsing, implements #99
Pro:
- reduces binary code size if only
floattype is used for parsing (numbers are discussed in #99)
Con:
- minimal binary code size increase if both
doubleandfloattypes are used for parsing - increases code bloat
The correct LUT is selected in compute_product_approximation, depending on the bit_precision.
Currently it selects the float LUT, if the bit_precision is smaller than 27. I actually do not like this switch, do you have a better proposal?
Adds:
- script/table_generation_float.py
- tests/example_test_float.cpp
- tests/example_test_mixed.cpp
Since one goal is to eventually move this library toward supporting from_chars fully, I am not sure I like the idea of sacrificing the general case for what I see as a rather specific use case (you want to use from_chars but you also only care about binary32).
Certainly, anything that increases the binary bloat of the general case does not move us in the right direction, I think. The idea of better supporting the isolated use case (from_chars but only with binary32) is nice, but I think it should come with no compromise over the general case.
Cheers!