当前位置:网站首页>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 ”
边栏推荐
- Vulnerability recurrence easy_ tornado
- 在Rainbond中一键部署高可用 EMQX 集群
- 漏洞複現-Fastjson 反序列化
- Open3d ISS key points
- Installation and configuration of PLSQL
- Lua programming learning notes
- Opencv learning note 4 - expansion / corrosion / open operation / close operation
- Interview questions (CAS)
- 雅思考试自己的复习进度以及方法使用【日更版】
- 利用 Helm 在各类 Kubernetes 中安装 Rainbond
猜你喜欢
使用 Nocalhost 开发 Rainbond 上的微服务应用
Bisenet features
The single value view in Splunk uses to replace numeric values with text
The field value in Splunk subquery fuzzy matching CSV is*
Practice of implementing cloud native Devops based on rainbow library app
2 - 3 arbre de recherche
GFS分布式文件系统
Battery and motor technology have received great attention, but electric control technology is rarely mentioned?
[untitled]
Using helm to install rainbow in various kubernetes
随机推荐
Several ways of lambda used in functions in kotlin (higher-order functions)
Implement your own dataset using bisenet
[quick start of Digital IC Verification] 14. Basic syntax of SystemVerilog learning 1 (array, queue, structure, enumeration, string... Including practical exercises)
Rainbow version 5.6 was released, adding a variety of installation methods and optimizing the topology operation experience
Thirteen forms of lambda in kotlin
rsync远程同步
CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand
XCiT学习笔记
Transformation function map and flatmap in kotlin
如何理解分布式架构和微服务架构呢
Grpc, oauth2, OpenSSL, two-way authentication, one-way authentication and other column directories
Full text query classification
Input of mathematical formula of obsidan
Interface as a parameter (interface callback)
SSM integration
单元测试报告成功率低
Through the "last mile" of legal services for the masses, fangzheng Puhua labor and personnel law self-service consulting service platform has been frequently "praised"
Deit learning notes
Virtual address space
Pytoch (VI) -- model tuning tricks