Home > Common Problem > body text

What data type is smallint?

coldplay.xixi
Release: 2022-04-07 15:38:54
Original
20759 people have browsed it

smallint is an exact numerical data type, its precision remains unchanged after arithmetic operations. It requires 2 bytes to store, and the syntax is [[ UNSIGNED ] SMALLINT].

What data type is smallint?

A type of data type.

Function: Requires 2 bytes of integer storage.

Syntax:

[ UNSIGNED ] SMALLINT
Copy after login

The SMALLINT data type is an exact numeric data type whose precision remains unchanged after arithmetic operations. It requires 2 bytes of storage.

  • Signed SMALLINT values ​​range from –2^15 (2^15 represents 2 raised to the 15th power) to 2^15 – 1, which is –32768 to 32767.

  • The unsigned SMALLINT value range is 0 to 2^16 – 1, that is, 0 to 65535. INT is 4-byte data, with a value range of -2^31 - 2^31. Therefore, taking into account the maximum data range, the smallint type is preferred.

Related free learning recommendations: php programming (video)

The above is the detailed content of What data type is smallint?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template