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

logical negation operator isn't included in core::ops #4105

Closed
thestinger opened this issue Dec 3, 2012 · 4 comments
Closed

logical negation operator isn't included in core::ops #4105

thestinger opened this issue Dec 3, 2012 · 4 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@thestinger
Copy link
Contributor

Rust uses ! as the bitwise complement operator rather than strictly a boolean logical negation, so libraries implementing numeric types could make use of it.

@sophiebits
Copy link
Contributor

Does it make sense to make a separate function for this? Its implementation would presumably just be x != 0, unless I'm misunderstanding what you're proposing.

@thestinger
Copy link
Contributor Author

@spicyj: In rust, ! is actually bitwise complement for integers, so !5 is -6. It makes sense to implement the same overload for other integer types (like big integers).

@sophiebits
Copy link
Contributor

Oops, I did misunderstand you completely – I thought you were talking about actual logical negation.

@ghost
Copy link

ghost commented Jan 27, 2013

This is now fixed.

@graydon graydon closed this as completed Feb 7, 2013
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
* feat: support raw reference operator

* feat: support const opt-out syntax

* feat: support half open range syntax
RalfJung pushed a commit to RalfJung/rust that referenced this issue Dec 26, 2024
Implement many-seeds mode directly in the driver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

3 participants