Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow checking for overflow without penalising fast path #51

Open
unzvfu opened this issue Aug 27, 2018 · 1 comment
Open

Allow checking for overflow without penalising fast path #51

unzvfu opened this issue Aug 27, 2018 · 1 comment

Comments

@unzvfu
Copy link
Collaborator

unzvfu commented Aug 27, 2018

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.

@unzvfu
Copy link
Collaborator Author

unzvfu commented Mar 21, 2020

Follow up at unzvfu#31.

@unzvfu unzvfu removed their assignment Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant