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

repeated unary operators #18

Closed
klakplok opened this issue Dec 3, 2013 · 0 comments
Closed

repeated unary operators #18

klakplok opened this issue Dec 3, 2013 · 0 comments

Comments

@klakplok
Copy link
Contributor

klakplok commented Dec 3, 2013

I read somewhere on the internet that ~expr was the same as ~~~~expr, which is not, it is a repeated application of the ~ operator, and it happens that applying a boolean negation an odd (and > 1) number of times is useless since it can be rewritten as a single one. Applying ~ twice is ok, it is a cast to bool (~~3 is T), but applying it four or more times is also useless.

Scilint should warn about a number of nested applications of ~ strictly superior to 2.
Scilint should also probably warn about a number of applications of - strictly superior to 1.

@lefessan lefessan closed this as completed Feb 8, 2016
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

No branches or pull requests

2 participants