当前位置:网站首页>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 ”
边栏推荐
- Offer harvester: add and sum two long string numbers (classic interview algorithm question)
- [quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
- Using nocalhost to develop microservice application on rainbow
- Input of mathematical formula of obsidan
- 解读创客思维与数学课程的实际运用
- 单元测试报告成功率低
- Lua programming learning notes
- MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
- 国标GB28181协议视频平台EasyGBS新增拉流超时配置
- Pytoch (VI) -- model tuning tricks
猜你喜欢

归并排序和非比较排序

【雅思口语】安娜口语学习记录 Part2

Ebpf cilium practice (2) - underlying network observability

Splunk查询csv lookup table数据动态查询

Analyzing the influence of robot science and technology development concept on Social Research

What is the function of paralleling a capacitor on the feedback resistance of the operational amplifier circuit

GFS distributed file system

Opencv learning notes 1 -- several methods of reading images

Wang Zijian: is the NFT of Tencent magic core worth buying?

一种适用于应用频繁测试下快速查看Pod的日志的方法(grep awk xargs kuberctl)
随机推荐
Iptables' state module (FTP service exercise)
Opencv learning note 3 - image smoothing / denoising
Rsync remote synchronization
SSM integration
Splunk子查询模糊匹配csv中字段值为*
Opencv learning note 4 - expansion / corrosion / open operation / close operation
Domain specific language / DSL in kotlin
Thirteen forms of lambda in kotlin
国标GB28181协议视频平台EasyGBS新增拉流超时配置
eBPF Cilium实战(2) - 底层网络可观测性
MES系統,是企業生產的必要選擇
Caractéristiques de bisenet
Practice of implementing cloud native Devops based on rainbow library app
2-3查找树
POJ - 3616 Milking Time(DP+LIS)
Low success rate of unit test report
Exercise arrangement 2.10, 11
Open3d ISS key points
Go语言中,函数是一种类型
The reified keyword in kotlin is used for generics




