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

added(*): Implmented And and Or operations using uint256 package #12

Merged

Conversation

0xsimulacra
Copy link
Contributor

The current pull request implement "And" and "Or" operations using only "uint256" package and not replaying on "math.big".

The test passed for me and it seems correct. Howerever I might be wrong :)

Just a side note, even on the "math.big" package there this logical expression:

 // x | (-y) == x | ^(y-1) == ^((y-1) &^ x) == -(^((y-1) &^ x) + 1)

However the least part (that is " -(^((y-1) &^ x) + 1)"), I suspect that is wrong, the correct should be, from my understanding, '"-(((y-1) &^ x) + 1)" i.e without the "not" operator in the begining. What make me also believe that it is only a typo is that this corrected expresion without the "not" operator in the begining is exactly what is implmented in "math.big" package.

Anyways, I followed closely what is implemented in "math.big" in my pull request.

@linhbkhn95
Copy link
Owner

linhbkhn95 commented May 22, 2024

Hi @0xsimulacra
Thank your PR.
I have known this problem. So, I marked it as TODO work. But, I don't have time to do it from that time.
LGTM!

@linhbkhn95 linhbkhn95 changed the title implmented And and Or operations using uint256 package added(*): Implmented And and Or operations using uint256 package May 22, 2024
@0xsimulacra
Copy link
Contributor Author

Hi @linhbkhn95,

The pleasure is mine and thank you for your input.

Yes, I have seen the TODO marking inside the conserned functions when I've read them the first time, hence I wanted to work on them.

@linhbkhn95 linhbkhn95 merged commit a218eaf into linhbkhn95:master May 24, 2024
2 checks passed
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.

None yet

2 participants