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

Hex operations can overflow #27

Closed
ManevilleF opened this issue Feb 7, 2023 · 1 comment
Closed

Hex operations can overflow #27

ManevilleF opened this issue Feb 7, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@ManevilleF
Copy link
Owner

With very high Hex coordinates, various methods can overflow like:

  • substraction
  • addition
  • multiplication
  • length / distance

Maybe we should add wrapping and saturating variants ?

@ManevilleF ManevilleF added the help wanted Extra attention is needed label Feb 7, 2023
@ManevilleF ManevilleF mentioned this issue Feb 7, 2023
4 tasks
@ManevilleF ManevilleF added this to the 0.4.0 milestone Feb 7, 2023
@ManevilleF ManevilleF mentioned this issue Feb 10, 2023
8 tasks
ManevilleF added a commit that referenced this issue Feb 10, 2023
> Closes #9 
> Addresses #27 

# Work done

- [x] `Hex::length` and `Hex::ulength` rework to reduce overflowing
cases (#27)
- [ ] Reworked `Div` impls for `Hex` to respect expected `length`
expectations (#9)
  - [x] `Div<f32>`
  - [x] `Div<i32>`
  - [ ] `Div<Self>` 
- [x] Adapted `Rem` impls to match the new division
- [x] Added `Hex::abs` method 
- [x] Updated example to showcase the division and rotations
@ManevilleF ManevilleF removed this from the 0.4.0 milestone Feb 13, 2023
@ManevilleF
Copy link
Owner Author

I think #28 changes in the Hex::length and Hex::ulength are enough for now, we will see for wrapping/saturating operations if they become a problem in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant