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

Add math & bitwise ops to U256 type #1798

Closed
2 tasks
nfurfaro opened this issue Jun 1, 2022 · 1 comment
Closed
2 tasks

Add math & bitwise ops to U256 type #1798

nfurfaro opened this issue Jun 1, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers lib: std Standard library

Comments

@nfurfaro
Copy link
Contributor

nfurfaro commented Jun 1, 2022

Probably not critical at this point, but it may be something we want to have eventually.
Possible uses:

  • handle very large integers (ie: overflowing U128 maths)
  • a convenient way to pack 4 u64's together as a single logical entity. Currently, users are trying to pack u64s into a b256 which is not really what a b256 is for semantically. This may in part be due to a misunderstanding of storage slots and word size in the FuelVM; Devs familiar with Solidity are often familiar with packing as much data as possible into a uint256 (a single storage slot).

Note: The basic U256 is implemented in #2103.
TODO:

  • add math operations to U256
  • add bitwise operations to U256
@nfurfaro nfurfaro added the lib: std Standard library label Jun 1, 2022
@nfurfaro nfurfaro moved this to Todo in Fuel Network Jun 1, 2022
@adlerjohn adlerjohn added enhancement New feature or request good first issue Good for newcomers labels Jun 1, 2022
@nfurfaro nfurfaro changed the title Consider adding a new U256 type Add math & bitwise ops to U256 type Jun 27, 2022
@rostyslavtyshko rostyslavtyshko self-assigned this Jul 2, 2022
@mohammadfawaz
Copy link
Contributor

Seems that this is now implemented in #2445

Repository owner moved this from Todo to Done in Fuel Network Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers lib: std Standard library
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants