variadic_table icon indicating copy to clipboard operation
variadic_table copied to clipboard

Overflow issuesss when printing INT64_MIN

Open kuku929 opened this issue 1 month ago • 0 comments

Consider the following:

#include <cstdint>
VariadicTable<std::int64_t> t({"x"});
t.addRow(INT64_MIN);

this throws a bad_alloc because the logic to determine size of the column does a std::log10(-x) which obviously overflows( -INT64_MIN = INT64_MAX + 1) so you get nan.

I patched it by doing std::log10(-1 * (x + 1)) for now but not sure if this is the best solution.

kuku929 avatar Dec 14 '25 09:12 kuku929