I was just flipping through the specification and found that byte is odd. Others are short, ushort, int, uint, long, and ulong. Why this naming of sbyte and byte instead of byte and ubyte?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s a matter of semantics. When you think of a byte you usually (at least I do) think of an 8-bit value from 0-255. So that’s what
byteis. The less common interpretation of the binary data is a signed value (sbyte) of -128 to 127.With integers, it’s more intuitive to think in terms of signed values, so that’s what the basic name style represents. The
uprefix then allows access to the less common unsigned semantics.