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

Fix u128 log rounding errors, and overflow reverts #6647

Merged
merged 16 commits into from
Oct 16, 2024

Conversation

SwayStar123
Copy link
Collaborator

@SwayStar123 SwayStar123 commented Oct 16, 2024

Description

Same as #6163 but for u128

Ensures the reverts on overflow and unsafe math take into account the flags set

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.

@SwayStar123 SwayStar123 self-assigned this Oct 16, 2024
@SwayStar123 SwayStar123 added bug Something isn't working lib: std Standard library labels Oct 16, 2024
sway-lib-std/src/u128.sw Outdated Show resolved Hide resolved
@K1-R1 K1-R1 self-requested a review October 16, 2024 08:35
@K1-R1 K1-R1 marked this pull request as ready for review October 16, 2024 08:35
@K1-R1 K1-R1 requested review from a team as code owners October 16, 2024 08:35
K1-R1
K1-R1 previously approved these changes Oct 16, 2024
@SwayStar123 SwayStar123 changed the title Fix u128 log rounding error Fix u128 log rounding errors, and overflow reverts Oct 16, 2024
@JoshuaBatty JoshuaBatty requested a review from K1-R1 October 16, 2024 10:46
alfiedotwtf
alfiedotwtf previously approved these changes Oct 16, 2024
Copy link
Contributor

@alfiedotwtf alfiedotwtf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it's worth resetting flags before every test starts, but that can be done at a later stage if needed.

JoshuaBatty
JoshuaBatty previously approved these changes Oct 16, 2024
@JoshuaBatty JoshuaBatty requested review from alfiedotwtf and a team October 16, 2024 11:24
K1-R1
K1-R1 previously approved these changes Oct 16, 2024
@SwayStar123 SwayStar123 dismissed stale reviews from K1-R1 and JoshuaBatty via 1eff119 October 16, 2024 11:30
@K1-R1 K1-R1 self-requested a review October 16, 2024 11:39
@JoshuaBatty JoshuaBatty merged commit 9f22fe8 into master Oct 16, 2024
38 checks passed
@JoshuaBatty JoshuaBatty deleted the fix-u128-log-rounding-error branch October 16, 2024 11:49
JoshuaBatty added a commit that referenced this pull request Oct 16, 2024
## Description
waiting on

~~#6645~~
~~#6647~~ 
~~#6649~~ 
~~#6650~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib: std Standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants