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 new type U128 #1478

Closed
nfurfaro opened this issue May 4, 2022 · 2 comments · Fixed by #1600
Closed

Add new type U128 #1478

nfurfaro opened this issue May 4, 2022 · 2 comments · Fixed by #1600
Assignees
Labels
bikeshedding For bikeshedding trivialities enhancement New feature or request lib: std Standard library

Comments

@nfurfaro
Copy link
Contributor

nfurfaro commented May 4, 2022

We need a type to contain the result of multiplying 2 u64s for example.
This should be opt-in, as in the default when performing math ops with a type should be to return the same type.

Bikeshedding discussion here: https://fuellabs.slack.com/archives/C01KBNGSWGJ/p1651596324523349

@nfurfaro nfurfaro added enhancement New feature or request bikeshedding For bikeshedding trivialities lib: std Standard library labels May 4, 2022
@nfurfaro nfurfaro self-assigned this May 4, 2022
@nfurfaro nfurfaro moved this to Todo in Fuel Network May 4, 2022
@adlerjohn adlerjohn changed the title Add new type u128 Add new type U128 May 4, 2022
@simonr0204
Copy link
Contributor

simonr0204 commented May 6, 2022

Started working on this here https://github.com/FuelLabs/sway/blob/simon-u128/sway-lib-std/src/u128.sw

Should methods on the U128 type be over and underflow safe by default? Could be a lot of overhead there if it means returning a Result from every arithmetic operation

@adlerjohn
Copy link
Contributor

Should methods on the U128 type be over and underflow safe by default?

Start with the minimum (panic on overflow), then add more functionality as we need.

@adlerjohn adlerjohn mentioned this issue May 18, 2022
2 tasks
Repository owner moved this from Todo to Done in Fuel Network May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bikeshedding For bikeshedding trivialities enhancement New feature or request lib: std Standard library
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants