当前位置:网站首页>1.4 - fixed and floating point numbers
1.4 - fixed and floating point numbers
2022-06-30 06:33:00 【It's Li sticky duck】
Catalog
2、 Classification of fixed point numbers
4、 Floating point numbers are stored in the computer
5、 Understand the order code and mantissa
3、 ... and 、 Test method 1: Characteristics of fixed-point numbers and floating-point numbers
One 、 Fixed-point number
1、 Definition
A number whose decimal point is fixed , It is called fixed point number ;
2、 Classification of fixed point numbers
Fixed point integers : Agreed decimal point Fixed after the least significant digit ;
Fixed point decimals : Agreed decimal point Fixed after sign bit , Before the most significant digit ;
Two 、 Floating point numbers
1、 understand
It is equivalent to scientific counting in life ; For example, in life 10 Base number 5000, It can be written in the following forms ;
It can be seen from the picture that , The position of the decimal point can be changed constantly ; And the change of decimal point position , It does not affect the overall value of the expression ; This is floating point number ;
So if you want to save 5000 The number of , You need to save both parts to be a complete number ;

2、 Definition
The decimal point is not fixed , It can change ;
A change in the position of the decimal point , It does not affect the size of the value ;
3、 expression

M: mantissa ;
R: base number ; Use the decimal system in life ,R Namely 10; Binary is used in computers ,R Namely 2;
e: Index part ; In computer, it is called step code ;
4、 Floating point numbers are stored in the computer
Because in the calculation set , The base number is 2, So there's no need to save ;
Just save mantissa and exponent ( Order code ), You can save a complete number ;
So the expression format of floating point number in computer consists of two formats : Order code + mantissa ;
![]()
5、 Understand the order code and mantissa
Order code : Determine the range of numerical representation , That is, the maximum number that this floating-point number can represent ;
mantissa : Determines the accuracy of the numerical representation ; The greater the mantissa, the more accurate the value is ;

Be careful :
Because the fixed length of binary bits in the computer is agreed to represent a number , So increase the length of the order code or the length of the mantissa , It is bound to lead to changes in another part ;
6、 Floating point operation
(1) Operation steps

(2) Antithetic order : Let the order codes of numbers be the same ;
for example , A number represented by scientific notation minus an integer B, It is not possible to subtract integers directly from the base of scientific counting , It is necessary to adjust the two numbers to the format of the same index before operation ;


(3) Mantissa calculation

(4) Result formatting
Convert the result into the corresponding format as required .
![]()
3、 ... and 、 Test method 1: Characteristics of fixed-point numbers and floating-point numbers

边栏推荐
- Connect to remote server
- 基础刷题(一)
- HCIA day 1
- Installing googleplay environment on Huawei mobile phones
- 46. full arrangement -dfs double hundred code
- Dynamic routing job
- Using C language pure for loop to implement ilovey
- 【微信小程序:单选、多选样式,背景色,圆角】
- [wechat applet: single or multiple styles, background color, rounded corners]
- Static routing job
猜你喜欢
随机推荐
Rhcsa day 1
Collection and method of traversing collection elements (1)
New project folder based on PIO plug-in in vscode -- Interpretation
Common address collection
Basic use of markdown
JS prototype chain object function relationship
Rotate dimension tool rolabelimg
Base64 explanation: playing with pictures Base64 encoding
Learn fpga---ram IP core and key parameters from the bottom structure
Network basics
Data read / write: realize data read / write function based on C # script in unity
880. 索引处的解码字符串
Zibll sub theme v6.4.1wordpress open source download_ Crack the original / use it directly / no tutorial required
Share problems solved
Go pack and unpack
1.6 - CPU组成
ini解析学习文档
When to use redis
反編譯正常回編譯出現問題自己解决辦法
Swoole process model diagram








