int is the ellipsis of short int, which accounts for 2 bytes of memory, representing the range: -32768~32767.Long is an ellipsis of long int, which accounts for 4 bytes of memory, representing the range: -2147483648~2147483647.Long Long is twice
First, analyze the characteristics of the basic data type, maximum and minimum values. 1, Basic type: int bits number: + Wrapper class: Java.lang.Integer Minimum: integer.min_value=-2147483648 (-2 of 31 Parties) Maximum value: integer.max_value=
1.cstring->int, Long
CString strtest = "1000 Test";
int i = 0;
i = _ttoi (strtest);
strtest = " -199 dollars";
Long L = 0;
L = _ttol (strtest);
Output:
i = 1000;
L =-199;
2.cstringchar*
2.1 char*->cstring
char* psz = "Test";
CString str
Basic data typesbyte =-128 and 127------------------------------------------------------------2 of 8 parties, 1 bytesShort =-32768 and 32767-------------------------------------------------------2 of 16 Parties, 2 bytesint = 2147483648 and 2147483647
unsigned int 0~4294967295int 2147483648~2147483647unsigned long 0~4294967295Long 2147483648~2147483647The maximum value of long long: 9223372036854775807The minimum value of long long:-9223372036854775808Unsigned the maximum value of long long: 18446
First, we want to understand the meaning of "bit", "byte", "word" (word), these three.bit is the smallest unit of storage and can only be placed in a machine language of 0 or 1.Byte (byte), 8 bits (bit) is a byte, so 1 bytes = 8 bits, 4 bytes is 32
First, the characteristics of the basic data type, number of digits, maximum and minimum values.1.Basic type: Short bits number: 16Packing type: Java.lang.ShortMinimum value: short.min_value=-32768 (-2 of 15 this party)Maximum value: short.max_value=
mark~~unsigned int 0~4294967295int-2147483648~2147483647unsigned long 0~4294967295long-2147483648~2147483647The maximum value of long long: 9223372036854775807The minimum value of long long:-9223372036854775808Unsigned the maximum value of long long:
Part of the content goes to: Java thoroughly understands the byte char short int float long doubleFirst say byte:This is an excerpt from the source code in Byte.java in the JDK:1 /**2 * A constant holding the minimum value a byte can3 * have, -27.4
public class Datatypechangehelper {
/**
* Converts a single byte of Byte to a 32-bit int
*
* @param b
* Byte
* @return Convert result
*/
public static int Unsignedbytetoint (byte b) {
return (int) B & 0xFF;
}
/**
*
Lucky to taste the mango today, found that there are many types of self-growth ID, but no long/int.One idea:1. Self-built a collection (table, assuming named: Identityentity, where Fields: _id, Key, Value, _id you know, key:collection name, need
Database fields such as amount, weight, and score are recommended for use with an int or bigint type.Usually our database design in the amount, weight and other fields related to the decimal place will be used float or decimal,mysql can also use
Python supports four different numeric types, including int (integer) long (Long integer) float (floating point actuals) complex (complex number),
Numeric data types store values. They are immutable data types, which means changing the value of the
unsigned int 0~4294967295 int 2147483648~2147483647 unsigned long 0~4294967295long Maximum value of 2147483648~2147483647long long: 9223372036854775807long long minimum: -9223372036854775808unsigned long Maximum value of long: 1844674407370
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.