Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is the decimal convention for fixed-point integers?
What is the decimal convention for fixed-point integers?
The lowest bit is on the right. If a fixed point is to represent an integer or a decimal, it can be divided into the following three situations:

Pure integer: for example, integer 100, the decimal point is actually in the last place, which is ignored.

Pure decimal: for example: 0. 123, the decimal point is fixed at the highest place.

Integer+decimal: for example, 1.24, 10.34, and the decimal point is at the specified position.

For the first two cases, pure integer and pure decimal, because the decimal point is fixed at the lowest and highest places, the principle is the same when expressed by fixed points. Only the integer part and the decimal part need to be converted separately according to the rule of decimal to binary.

For the case of integer+decimal, when it is expressed by fixed point, the position of decimal point needs to be agreed before it can be expressed by computer.

Unsigned fixed-point number Unsigned fixed-point number. All the binary digits of the word length in the machine have no sign digits, and they are all numerical digits. For example, the decimal point 1.2 is converted into a fixed 16, and the position of the decimal point is agreed between 14 and 15.

According to the calculation results, the decimal 1.2 can be expressed by the unsigned fixed point number 1966 1 in Q 14 format.

Unsigned fixed points are relatively simple, and there are no negative decimals; But the signed fixed point is not so simple, because there are positive numbers and negative numbers, and their calculation methods are different.