bitwise icon indicating copy to clipboard operation
bitwise copied to clipboard

Bitwidth not enforced, oveflow is a bit awkward

Open VegaDeftwing opened this issue 3 years ago • 3 comments

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 avatar Feb 25 '22 17:02 VegaDeftwing

image Underflow is even worse

VegaDeftwing avatar Feb 25 '22 17:02 VegaDeftwing

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

mellowcandle avatar May 15 '23 18:05 mellowcandle

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.

VegaDeftwing avatar May 15 '23 22:05 VegaDeftwing