Commit Graph

4 Commits

Author SHA1 Message Date
Alexander Hans
3738976bdc fix(bazel): add missing load statements
Bazel 9 drops builtin `cc_*` rules, they need to be loaded explicitly now.
2026-01-01 10:14:47 -06:00
Simon Gene Gottlieb
c7aa78d294 fix: overflow buffer with large precision values
Issue #1385 demonstrates how a large 'precision' value can cause buffer
overflows. Originally, the buffer was designed to fit any scientific
notation. But the precision changes at which point large floating point
numbers are displayed in scientific notation or default notation.
In case of the default notation many extra zeros have to be printed,
this was not reflected in the output_buffer and an overflow could
occur.

This PR computes the number of zero that do not fit into the static
buffer and appends them at the end of the function triggering potential
a second dynamic allocation. (The first allocation is the std::string
allocation).
2025-12-28 17:33:09 -06:00
Simon Gene Gottlieb
a2826e8983 fix: unittests sets locale before testing
the convert_with_stringstream seems to be missing a
.imbue() call to set the locale independent of the global state.
Not setting this, can in some settings lead to errors, see Issue #1366.
2025-12-28 17:32:43 -06:00
Simon Gene Gottlieb
5d9e4b6251 patch: split fp_to_string.h into fptostring.h and fptostring.cpp 2024-11-07 15:14:36 -06:00