Monday, December 2, 2019

Signed vs Unsigned Integers

Today I had cause to learn the difference between signed and unsigned integers (specifically in C#, but it looks to be a pretty standard topic). It turns out the difference is super simple: signed integers can be positive or negative, but unsigned integers must be positive. Since unsigned integers must be positive, they can hold larger numbers.

So I texted my brother just to say today I learned something, but that I thought the name could've been better. His reply: "Signed means it uses a sign and unsigned meaning the sign is always positive." and my mind is blown. That explanation makes perfect sense, but more importantly (to me) it might make it easier to remember this in the future.