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

[FEATURE] Bitwise operators #32

Closed
frankhart2018 opened this issue Sep 2, 2020 · 11 comments
Closed

[FEATURE] Bitwise operators #32

frankhart2018 opened this issue Sep 2, 2020 · 11 comments
Assignees
Labels
enhancement New feature or request KWoC'20 These issues are being listed as part of KWoC'20 moderate Moderate problem

Comments

@frankhart2018
Copy link
Member

Is your feature request related to a problem? Please describe.
Add support for bitwise operators in simC.

Describe the solution you'd like
Check implementation of other operators.

Note: Discuss the bitwise operators and their syntax with a maintainer before implementing.

@frankhart2018 frankhart2018 added enhancement New feature or request hacktoberfest Part of hacktoberfest labels Sep 2, 2020
@PranshulDobriyal PranshulDobriyal added the moderate Moderate problem label Sep 6, 2020
@cimplec cimplec deleted a comment from frankhart2018 Oct 24, 2020
@cimplec cimplec deleted a comment from puranjaymohan Oct 24, 2020
@frankhart2018 frankhart2018 removed the hacktoberfest Part of hacktoberfest label Nov 1, 2020
@dhairyaj dhairyaj added the KWoC'20 These issues are being listed as part of KWoC'20 label Dec 4, 2020
@shobhit10058
Copy link
Contributor

I see that a&b is converted as it is but a|b is not because it is by default assumed in the code that | comes with | only. so b is replaced by | and lastly ^ is working for xor as ^ is used for power. So, I format should be
a AND b
a OR b
a XOR b
These do not conflict with existing one. Parsing could be done differently for these but still they need to handled like other binary operators

@shobhit10058
Copy link
Contributor

I would like to work on it.

@frankhart2018
Copy link
Member Author

@shobhit10058 AND, OR, XOR is confusing as users might think it is normal AND, OR, XOR and not bitwise versions of these operators. I believe retaining C's syntax of & (Bitwise and), | (Bitwise or), and ^ (Bitwise xor) will be best. Do let me know if you think otherwise 😄

@shobhit10058
Copy link
Contributor

shobhit10058 commented Dec 7, 2020

But what can AND,or, xor of two numbers mean other than bitwise operators

@shobhit10058
Copy link
Contributor

we can use the original also, just we need to change the ^ to work as xor. power function can be given some other name then

@frankhart2018
Copy link
Member Author

Yeah I guess we can give ** to power like python. Using AND, OR, XOR might mean the regular AND, OR and XOR. As in True AND False = True, like in python.

@shobhit10058
Copy link
Contributor

yes

@shobhit10058
Copy link
Contributor

ok then I can try working with this

@frankhart2018
Copy link
Member Author

Sure assigning this to you @shobhit10058.

@shobhit10058
Copy link
Contributor

have you seen my commit?

@frankhart2018
Copy link
Member Author

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request KWoC'20 These issues are being listed as part of KWoC'20 moderate Moderate problem
Projects
None yet
Development

No branches or pull requests

5 participants