3 ms·
http://www.cplusplus.com/doc/tutorial/operators/ http://www.cplusplus.com/doc/tutorial/operators/ https://www.geeksforgeeks.org/bitwise-operators-in-c-cpp/ htt
by AnimalMuppet 7y ago
http://www.cplusplus.com/doc/tutorial/operators/ http://www.cplusplus.com/doc/tutorial/operators/
https://www.geeksforgeeks.org/bitwise-operators-in-c-cpp/ https://www.geeksforgeeks.org/bitwise-operators-in-c-cpp/
https://www.tutorialspoint.com/cprogramming/c_operators.htm https://www.tutorialspoint.com/cprogramming/c_operators.htm
All say the same thing.
(But, BTW, I am home.)
- kragen 7y agoOnly the first of those is a reliable source, and it doesn't mention one's complement machines at all, or for that matter C. It's a summary of the C++ standard, which agrees with the C standard on the relevant points, but both are considerably more liberal than the practical requirements on actual implementations of the languages. It seems that you have no experience of or reliable knowledge about programming in C on one's-complement or sign-magnitude machines, and furthermore you seem to be unclear on the difference between C and C++. So probably you shouldn't be so confident in your opinions!
- AnimalMuppet 7y agoThe first of those literally says "Unary complement (bit inversion)". That's what the standard says. "Bit inversion" tells you exactly what's supposed to happen, regardless of the architecture of the machine. Or is your claim that the website, despite being based on the C++ standard, is simplifying it by assuming that all machines are two's-complement? All right then, what is the actual text of the C++ standard? (You're the one making the claim that on ones-complement machines, the standard doesn't require what everyone thinks it does, so you get the burden of proof. Also, I don't have access to the text of the standard.) So far as I know, the C standard does not differ from the C++ standard on what that operator does. If you claim it does, I'll ask you to document it. Instead of throwing insults at others' level of knowledge, I suspect you should be a bit more cautious about your own.