当前位置:网站首页>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 ”
边栏推荐
- [IELTS speaking] Anna's oral learning records Part3
- 【雅思口语】安娜口语学习记录 Part3
- Golang compilation constraint / conditional compilation (/ / +build < tags>)
- MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
- [IELTS speaking] Anna's oral learning records part2
- Open3d ISS key points
- Installation and configuration of PLSQL
- Kotlin combines flatmap for filtering and zip merge operators
- Xcit learning notes
- National standard gb28181 protocol video platform easygbs adds streaming timeout configuration
猜你喜欢

rsync远程同步

2 - 3 arbre de recherche

使用 Nocalhost 开发 Rainbond 上的微服务应用

Low success rate of unit test report

SSM integration

opencv学习笔记三——图像平滑/去噪处理

一文了解如何源码编译Rainbond基础组件

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

Rainbond结合NeuVector实践容器安全管理

In go language, function is a type
随机推荐
Virtual address space
Implementation method of data platform landing
【雅思口语】安娜口语学习记录 Part2
Explore creativity in steam art design
[IELTS speaking] Anna's oral learning records Part3
JS copy picture to clipboard read clipboard
[go ~ 0 to 1] obtain timestamp, time comparison, time format conversion, sleep and timer on the seventh day
Le système mes est un choix nécessaire pour la production de l'entreprise
BiSeNet的特点
eBPF Cilium实战(1) - 基于团队的网络隔离
Wang Zijian: is the NFT of Tencent magic core worth buying?
PVTV2--Pyramid Vision TransformerV2学习笔记
Offer harvester: add and sum two long string numbers (classic interview algorithm question)
Analyzing the influence of robot science and technology development concept on Social Research
DeiT学习笔记
XCiT学习笔记
Golang compilation constraint / conditional compilation (/ / +build < tags>)
IELTS review progress and method use [daily revision]
Splunk query CSV lookup table data dynamic query
【雅思口语】安娜口语学习记录 Part3




