December 2014
Beginner
300 pages
8h 9m
English
There is a difference between signed and unsigned types. It has nothing to do with autographs. When you have a signed type, it can be positive or negative. The types that start with Int are signed and can be either negative or positive. How does Swift represent a negative value in 8 bits internally? The leftmost bit says whether the number is positive or negative. This is how it is represented internally. A 1 as the first bit means the Int is negative, and a 0 means positive. Any of the types that are Ints (Int8, Int16, Int32, and so on) use the first bit to say whether the number is negative or positive. If Int8 has 8 bits available, it now has 7 to represent the number and 1 to represent ...
Read now
Unlock full access