You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous code seems to have only done a right shift, if the rhs was a constant. Moreover, it did an unsigned division.
The current code does not handle integer arithmetic, ie overflows etc, so right shifts are doing field divisions instead of integer divisions. This is most likely not the correct route forward.
Happy Case
We should rationalize whether we want shift left and shift right to work only for unsigned integers.
This would mean that both implementation would be doing integer mul and integer division. The previous code was doing Field Mul and integer division.
Alternatives Considered
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered:
Left and right shift are implemented for non-const unsigned integers in PR #2072
The only missing piece is to have bit shift for signed integers. However it is not worth to implement this as long as signed integers are not fully supported.
# Description
## Problem\*
Resolves#1479
## Summary\*
Add support for bit shifts with signed integers.
We use Rust behaviour for overflows.
## Additional Context
## Documentation\*
Check one:
- [X] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.
# PR Checklist\*
- [X] I have tested the changes locally.
- [X] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
Problem
The previous code seems to have only done a right shift, if the
rhs
was a constant. Moreover, it did an unsigned division.The current code does not handle integer arithmetic, ie overflows etc, so right shifts are doing field divisions instead of integer divisions. This is most likely not the correct route forward.
Happy Case
We should rationalize whether we want shift left and shift right to work only for unsigned integers.
This would mean that both implementation would be doing integer mul and integer division. The previous code was doing Field Mul and integer division.
Alternatives Considered
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: