Skip to content

Better error message when storing too large integer #327

@bakerk98

Description

@bakerk98

I'm trying to store a big integer in the e-graph, and I've found that BigInt can't store it.

Running on egglog-11.0.0,

When running the code:

with EGraph() as egraph:
    bigint = BigInt(0xfffffffffffffff8)
    egraph.register(bigint)

I get the error:
OverflowError: Python int too large to convert to C long

I tried to store the larger int as a PyObject created from the int, and that works.

with EGraph() as egraph:
    pyobj = PyObject(0xfffffffffffffff8)
    egraph.register(pyobj)

I'm not sure if this is user error and maybe I should use a different primitive or if PyObject is the best way to store the number instead, but any help is appreciated. I'd like to be able to use native egglog types if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions