Skip to content

Allow checking for overflow without penalising fast path #51

@unzvfu

Description

@unzvfu

Currently, to assert that addition doesn't overflow, we

add_cy(s, cy, a, b);
assert(digit::is_zero(cy));

If NDEBUG is not set, then this checks that overflow hasn't occurred. If NDEBUG is set, it's possible (need to verify) that some carry handling code is generated; this is wasteful as it isn't used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions