Common Operating Systems:
Android: only 32-bit
IOS: only 32-bit
Linux Server (centos, Ubuntu, RedHat, etc.): 64-bit (used by most companies), 32-bit (obsolete)
Windows PC: 64-bit, 32-bit
Common Software:
Android app: Java or C ++. If Java is used and OS is irrelevant, Int Is 64-bit. If C ++ is used, it is to be verified.
IOS app: Object C, OS-related. Int Is 32 bits.
PHP: OS-related. The compiling and installation are the same as those on the server. The Int value is 64-bit or 32-bit.
MySQL: OS-independent. Int Is 64-bit.
Javascript in 32-bit browsers (chrome and Firefox): about trillion, to be determined, no authoritative documentation found
Javascript in 64-bit browsers (waterfox): about trillion, to be determined, no authoritative documentation found
VaR A = 9000000000000001; alert (A-1 + 1 );
For API Program Development Impact:
When JSON is provided to the app and browser JS engines through PHP APIs, the int range of Android, IOS, and browser JS is inconsistent because PHP Web server is 64-bit.
The 32-bit int value is about 2.1 billion. For example, if the total user capacity of the network disk is 5 gib, the PHP interface returns the following data:
{
"Capacity": 5368709120, // capacity: 5.3 billion bytes, that is, 5 gib, over 2.1 billion
"Used_space": 1073741824
}
Result: The Android Java app is normal, the iOS app cannot process data, and the browser Javascript is normal.
Therefore, you need to use a string instead of an int. After IOS receives the result, it is necessary to split the integers. That is:
{
"Capacity": "5368709120 ",
"Used_space": "1073741824"
}
References:
Http://www.cnblogs.com/sink_cup/archive/2010/12/12/php_intval_mysql_int.html