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 implementation rounding errors #6126

Closed
bitzoic opened this issue Jun 14, 2024 · 2 comments · Fixed by #6163
Closed

u256 log implementation rounding errors #6126

bitzoic opened this issue Jun 14, 2024 · 2 comments · Fixed by #6163
Assignees
Labels
bug Something isn't working lib: std Standard library

Comments

@bitzoic
Copy link
Member

bitzoic commented Jun 14, 2024

When calling log on the u256 type rounding error can occur. This should be addressed or a warning should be added.

@bitzoic bitzoic added the lib: std Standard library label Jun 14, 2024
@xunilrj
Copy link
Contributor

xunilrj commented Jun 14, 2024

Do we have an example? So I can understand a little bit better the peoblem.

@SwayStar123 SwayStar123 self-assigned this Jun 19, 2024
@bitzoic
Copy link
Member Author

bitzoic commented Jun 19, 2024

Blocked by #6143

@bitzoic bitzoic added the bug Something isn't working label Jun 21, 2024
IGI-111 added a commit that referenced this issue Jul 1, 2024
## Description
The current implementation of u256 logarithm will frequently output
wrong values due to rounding errors

Closes #6126

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: IGI-111 <igi-111@protonmail.com>
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 a pull request may close this issue.

3 participants