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

checked arithmetic operations #32

Closed
andrewrk opened this issue Dec 14, 2015 · 0 comments
Closed

checked arithmetic operations #32

andrewrk opened this issue Dec 14, 2015 · 0 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase.

Comments

@andrewrk
Copy link
Member

There should be a way to perform basic arithmetic operations which can potentially overflow, such as addition, subtraction, and multiplication, and get the result as well as a boolean indicating whether it overflowed.

See for inspiration:
http://clang.llvm.org/docs/LanguageExtensions.html#checked-arithmetic-builtins

In debug mode, we might codegen this every time and do a panic if overflow occurs.

@andrewrk andrewrk added the enhancement Solving this issue will likely involve adding new logic or components to the codebase. label Dec 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Projects
None yet
Development

No branches or pull requests

1 participant