Skip to content

Overflow issuesss when printing INT64_MIN #19

@kuku929

Description

@kuku929

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions