Today, I encountered a problem in my project. A 1.7 billion number and a 0.6 billion number crossed the border ......, Then we found that the maximum value of the signed integer is 2.1 billion, and the maximum value of the unsigned integer is 4.2 billion.
Then, I decided to switch the int type to the long type storage. The miracle was that it was out of the way ......, The more it is like an integer ...... Your sister ......
Google couldn't open it, and then Baidu ...... Lima ...... Baidu's IQ is exposed at a moment, and the desired results are not found at all. It's awesome to make a decisive 360 search.
The basic data types of objective-C are: int/long int /. Suddenly I am in a mess ......
There are still many things to do. Let's give a brief answer here. In objectivec, the length of int and long is determined by the operating system. Generally, the length of int is the same as that of long, such as IOS! In iOS, Int = long!
Then long is short for long int, and long is short for long Int.
To sum up, in IOS:
Int = long int
Long long Int = long = int * 2
That is to say, I must use the long type to store more than 4.2 billion of the numbers!
Nslog (@ "% Li", XXX );
Nslog (@ "% llI", XXX );