当前位置:网站首页>Is signed or unsigned selected to create an integer field in MySQL? The answer is as follows:
Is signed or unsigned selected to create an integer field in MySQL? The answer is as follows:
2022-06-13 08:22:00 【SDL Dahua】
[ recommend ] Small program version system background rapid development Recommend a real-time news interface : Suitable for news APP、 Website 、 Small program etc.
[ Words belong to excerpts ]
The symbol is “+” Plus sign and “-” minus sign ,+ No. is omitted , Positive numbers are stored in the database table , The default is not to display “+” Number , If you save a negative number , Then it will show “-” Number .
Each type of integer is unsigned (unsigned) And signed (signed) Two types of (float and double Always signed ), By default, declared integer variables are signed types (char A little special ), If you want to declare an unsigned type, you need to add... Before the type unsigned.
The difference between unsigned and signed versions is that unsigned types can save 2 Times positive integer data of signed type , such as 16 One of the bit systems smallint The range of data that can be stored is -32768~32767, and unsigned The range of data that can be stored is 0~65535.
Because in the computer , Integers are stored as complements . According to the highest order , If it is 1, A signed number is a negative number ; If it's an unsigned number , Are interpreted as positive numbers .
in addition ,unsigned If you omit the last keyword , Most compilers will think of it as unsigned int.
In short, because Int Type occupation 4 byte , That is to say 16 position ,2^16 = 65535, If there are sign bits + - Equally divided on both sides , If not, give it all +.

边栏推荐
- CCNP_ Summary (Continued)
- 学习记录4: einops // cudnn.benchamark=true // hook
- Homestead environment setup
- Import the robot model built by SolidWorks into ROS
- Live broadcast review | bas technology innovation exploration under active defense system
- Leetcode- sort arrays by parity
- How can the small and medium-sized lighting industry make use of the digital transformation to stand out from the encirclement?
- Buuctf web (III)
- Cosmos Starport installation and startup
- Disk C is full? A few simple tips teach you to release and clean up tens of gigabytes of space on the C disk, the most effective way to clean up the C disk
猜你喜欢

MySQL sorts according to the specified order of the specified fields

Cosmos Starport installation and startup

HCIP_ Static experiment

HCIP_ MGRE comprehensive experiment

What software can be used to solve the problems faced by the auto parts industry

How to efficiently manage commodities and inventory in the beverage wholesale industry

MySQL queries difference sets (missing data) by linking tables based on an associated field

ERP基础数据 金蝶

Redis subscribe connection timeout interrupt problem solution

Detailed explanation of digital certificate and Ca
随机推荐
Start from scratch - implement the jpetstore website -1- establish the project framework and project introduction
Shellshock Attack Lab
Sizeof, strlen find character length
Local shooting range 2- file upload vulnerability (III) - Network Security
Bidirectional retransmission step experiment
How to modify desktop path in win10 system
[complete information static game characteristics of Nash equilibrium]
array_ Pop error: only variables should be passed by reference
When submitting the laravel admin form and using the required verification, an error is reported when the value is 0
Give code vitality -- the way to read code neatly
MySQL query exercise
平面合并(MATLAB)
MySQL installation and configuration under Windows
星巴克创始人:出于安全考量 或不再向非店内消费者开放“公厕”
口碑好的食材配送信息化管理系统怎么样?
DHCP principle and configuration
名次的确定
SQL injection experiment
Dest0g3 520迎新赛
Gtk+ programming example on page 115 - simplest progress bar 2 with steps to write GTK program using anjuta