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

u256: log, log2 and sqrt impl (#5329) #5558

Closed
wants to merge 0 commits into from
Closed

u256: log, log2 and sqrt impl (#5329) #5558

wants to merge 0 commits into from

Conversation

sudhackar
Copy link
Contributor

@sudhackar sudhackar commented Feb 7, 2024

Description

simple changes that borrows on u128 implementations of log, log2 and sqrt - only with little changes. Have added a test on u128 too as it was missing for log and the output was confusing to at least me.

This should fix #5329

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@CLAassistant
Copy link

CLAassistant commented Feb 7, 2024

CLA assistant check
All committers have signed the CLA.

@sudhackar
Copy link
Contributor Author

ping @SwayStar123 as requested

@SwayStar123
Copy link
Member

Thank you for the PR! But it looks like you added the functions to the wrong type. the u256 library houses the deprecated U256 type. There is now a primitive u256 type, it needs the implementation in the math library https://github.com/FuelLabs/sway/blob/master/sway-lib-std/src/math.sw

@sudhackar
Copy link
Contributor Author

oof. my bad. Let me do that.

Should I scrub off these changes too?

@SwayStar123
Copy link
Member

Yes please remove the changes related to the deprecated structs. As they will eventually be removed entirely, they are only preserved currently to give time for teams to migrate to the primitive type

@sudhackar sudhackar closed this Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

math.sw primitive u256 missing trait implementations
3 participants