当前位置:网站首页>Data type - floating point (C language)
Data type - floating point (C language)
2022-07-07 08:30:00 【It's a dream, it's you!】
Catalog
1 Understand the representation and storage form of floating point numbers
1.1 Floating point classification
1.2 General representation of representation
1.3 Representation form — Exponential representation
1.4 Floating point storage format
2 Floating point variables and constants
3 Comparison between floating-point numbers and zero values
3.1 Floating point number none “ zero ”
3.2 Floating point “ Zero value ”
1 Understand the representation and storage form of floating point numbers
1.1 Floating point classification
C Language provides 3 There are specific floating-point types :(1)float- Single precision floating point(2)double- Double precision floating point(3)long double- Long double precision floating point1.2 General representation of representation
(1) General notation :[ Integral part ].[ Mantissa part ].The decimal point cannot be omitted , The integer part and mantissa part can be omitted , But you can't omit .1.3 Representation form — Exponential representation
Index method : [ Sign bit ][ Mantissa part ]e[ Index part ].Format requirements :e And front must There are numbers ,e and E All are OK Index The part can be positive or negative or 0, but Must be an integer .1.4 Floating point storage format
The storage format is divided into three parts : Symbol part 、 mantissa Part and Index part .
2 Floating point variables and constants
2.1 Floating point constants
The default is double type , Such as :3.5、4.0 And 3.5D、4.0d Equivalent .Single precision constant , You need to explicitly add a suffix after the value f or F Such as 3.5f or 4.0F etc. .2.2 Floating point variables
float f1=3.14F,f2;f2=9.8f;double d1;d1=3.2; Equivalent tod1=3.2d
3 Comparison between floating-point numbers and zero values
3.1 Floating point number none “ zero ”
3.2 Floating point “ Zero value ”
Floating point numbers x And 0 Of The distance is less than or equal to the set value , I think x by “ zero ”Illustrate with examples :math.h in fabs Find the absolute value of floating point numberconst float ESP=1E-6F;fabs(x-0)<=ESP Represents a floating point type x by zero value .Floating point numbers x And 0 Of The distance is less than or equal to the set value , I think x by “ zero ”
边栏推荐
- Transformation function map and flatmap in kotlin
- Opencv learning notes 1 -- several methods of reading images
- Exercise arrangement 2.10, 11
- 使用BiSeNet实现自己的数据集
- Detailed explanation of apply, also, let, run functions and principle analysis of internal source code in kotlin
- MES system is a necessary choice for enterprise production
- Use of out covariance and in inversion in kotlin
- Train your dataset with swinunet
- What is the function of paralleling a capacitor on the feedback resistance of the operational amplifier circuit
- Kotlin combines flatmap for filtering and zip merge operators
猜你喜欢
BiSeNet的特点
Interpreting the practical application of maker thinking and mathematics curriculum
云原生存储解决方案Rook-Ceph与Rainbond结合的实践
Give full play to the wide practicality of maker education space
Openvscode cloud ide joins rainbow integrated development system
Rsync remote synchronization
Using nocalhost to develop microservice application on rainbow
探索STEAM艺术设计中的创造力
2 - 3 arbre de recherche
Réplication de vulnérabilité - désrialisation fastjson
随机推荐
Pytoch (VI) -- model tuning tricks
eBPF Cilium实战(1) - 基于团队的网络隔离
Understanding of out covariance, in inversion and invariance in kotlin
Improve the delivery efficiency of enterprise products (1) -- one click installation and upgrade of enterprise applications
Openjudge noi 2.1 1752: chicken and rabbit in the same cage
Kotlin combines flatmap for filtering and zip merge operators
opencv学习笔记三——图像平滑/去噪处理
Train your dataset with swinunet
Standard function let and generic extension function in kotlin
[quick start of Digital IC Verification] 10. Verilog RTL design must know FIFO
DeiT学习笔记
opencv学习笔记四——膨胀/腐蚀/开运算/闭运算
Bisenet features
eBPF Cilium实战(2) - 底层网络可观测性
POJ - 3616 Milking Time(DP+LIS)
Implement your own dataset using bisenet
Splunk中single value视图使用将数值替换为文字
opencv学习笔记五——梯度计算/边缘检测
CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand
Don't stop chasing the wind and the moon. Spring mountain is at the end of Pingwu