Home  >  Article  >  What is the maximum integer that can be stored in the interger variable?

What is the maximum integer that can be stored in the interger variable?

烟雨青岚
烟雨青岚Original
2020-07-07 16:06:5011813browse

The maximum integer that can be stored in the interger variable is 32767. Integer is a data type. In the programming language C, it is an identifier used to define integer type variables; in microcomputers, int occupies 2 bytes, 16 bits, and the data range is "-32768~32767[-2^ 15~2^15-1]".

What is the maximum integer that can be stored in the interger variable?

The maximum integer that can be stored in an interger variable is 32767

Integer data type

int is A data type, in the programming language C, that is an identifier used to define variables of integer type.

In a general computer, int occupies 4 bytes, 32 bits, and the data range is -2147483648~2147483647[-2^31~2^31-1].

In microcomputers, int occupies 2 bytes, 16 bits, and the data range is -32768~32767[-2^15~2^15-1].

Integer An integer data is used to store integers, including positive integers, negative integers and zero.

Integer constants are represented by decimal integers. For example, 1991, 0, -123, etc. are all integer constants. Neither 52.0 nor 131.4 are integer constants.

Integer variables are stored as the length closest to the compilation environment. For example, in a 32-bit compilation environment, Integer is 32 bits, and its range is between -2^15 and 2^15-1.

The type declaration character for Integer in VB is the percent sign (%). In Pascal it is integer. It is abbreviated as int in C language.

integer, integer/integer number, as opposed to decimal/floating point number, is one of the basic data types of programming languages, used to indicate the data type of variables, and sometimes used for constants (variables, expressions) Forced data type conversion.

The length and value range of integer data are not fixed and are affected by the compilation environment. When making this type declaration in different programming languages, the specific implementation methods may also be different.

For more related knowledge, please visit PHP Chinese website! !

The above is the detailed content of What is the maximum integer that can be stored in the interger variable?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn