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

Bitwidth not enforced, oveflow is a bit awkward #55

Open
VegaDeftwing opened this issue Feb 25, 2022 · 3 comments
Open

Bitwidth not enforced, oveflow is a bit awkward #55

VegaDeftwing opened this issue Feb 25, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@VegaDeftwing
Copy link

Describe the bug
Overflow not handled elegantly

To Reproduce
Steps to reproduce the behavior:

  1. Set width to a low amount eg: :width 8
  2. Add two numbers that total higher than the max value for that width eg: 0xff + 1

Expected behavior
Overflow should probably be truncated, to resemble the behavior in most programming languages and provide a warning

Screenshots
image

Version:

  • 0.43

Desktop (please complete the following information):

  • OS: Arch Linux
@VegaDeftwing VegaDeftwing added the bug Something isn't working label Feb 25, 2022
@VegaDeftwing
Copy link
Author

image
Underflow is even worse

@mellowcandle
Copy link
Owner

You're correct.
I will fix it. Thanks for reporting.

@VegaDeftwing
Copy link
Author

In the original report I said truncated which is probably wrong. It'd be more useful if it actually overflowed, so on width 8 just % 0xFF etc.

mellowcandle added a commit that referenced this issue Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants