KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Seeking to clarify something. It is my understanding that with regard to arithmetical, logical bitwise shifts: << work the same for both >> shifts differ in that logical shift will always pad byte with 0, whereas arithmetical shift will pad it with the sign bit. How can I differentiate this using C? From what I understand, actual operators are the same << , >> How would command differ between: int i=1; printf ("%d\n", i >> 1); // logical shift int j=1; printf ("%d\n", j >> 1); // arithmetical shift Please let me know,
Tags (comma-separated)
Save Edits
Cancel