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

feat: bitwise not #2503

Closed
milancermak opened this issue Mar 15, 2023 · 2 comments · Fixed by #3021
Closed

feat: bitwise not #2503

milancermak opened this issue Mar 15, 2023 · 2 comments · Fixed by #3021
Labels
enhancement New feature or request

Comments

@milancermak
Copy link
Contributor

Feature Request

Describe the Feature Request

So far, there's no support for bitwise not in Cairo 1. Cairo 0 offered a bitwise_not function. Rust has ! that uses the Not trait. Cairo 1 already declares a Not trait, so what's missing is only the implementation of it on the appropriate types.

Describe Preferred Solution

let some_bits = 27_u8; // 0b11011
let not_some_bits = !some_bits;
assert(not_some_bits == 228_u8, 'nope'); // 228 == 0b11100100
@milancermak milancermak added the enhancement New feature or request label Mar 15, 2023
@orizi
Copy link
Collaborator

orizi commented Mar 27, 2023

sounds like a nice idea - although my c++ sensitivities confuses me in this case (! always sounds boolean to me, not bitwise) - we should ask around a bit around this before deciding (was a bit surprised myself that rust does work that way)

@milancermak
Copy link
Contributor Author

Any news on this?

@orizi orizi linked a pull request May 3, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants