Skip to content

Overflow issuesss when printing INT64_MIN #19

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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