Skip to Content
C语言核心技术(原书第2版)
book

C语言核心技术(原书第2版)

by Peter Prinz, Tony Crawford
August 2017
Intermediate to advanced
798 pages
17h 44m
Chinese
China Machine Press
Content preview from C语言核心技术(原书第2版)
标准头
|
283
标准头
s
x
的符号;
s
=1
或
s
=
-
1
d
i
x
的有效数(或称为尾数(
mantissa
))中以
b
为基数的数位,通用表达方式为
0.
d
1
d
2
…
d
p
;如果
x
≠
0
,则
d
1
>0
p
有效数位数(更精确地说,小数部分的位数)
b
指数的基数;
b
>l
e
整型指数;
e
min
≤
e
≤
e
max
浮点类型除了可以表示规格化的浮点值以外,也可能表示其他的值,例如:
•
非正常浮点数,即那些
x
≠
0
、
e
=
e
min
与
d
1
=0
的浮点数。
•
非规格化浮点数,即
x
≠
0
、
e
>
e
min
与
d
1
=0
。
•
无限值,即取值为
+
∞或-∞。
• NaN
,即代表无效浮点数的值。
NaN
的意思是“
not a number
”(非数值)。
NaN
可以是安静类型(
quiet
)的
NaN
,也可以是信号类型(
signaling
)的
NaN
。在计算
一个算术表达式过程中导致出现信号类型
NaN
时,运行系统会设置浮点环境的异常标记
FE_INVALID
。安静类型的
NaN
不会设置异常标记。
取近似值模式和计算方法
下面两个宏定义在头文件
float.h
中,它们提供了如何进行浮点算术运算的细节:
FLT_ROUNDS
该宏表示当前激活的取近似值方式,在
float.h
所定义的宏中,它是唯一可以在运行时
被动态改变值的。它可以取下面的值:
-
1
未确定
0
往零的方向
1
往最接近的能够表示的值的方向
2
往次大值的方向
3
往次小值的方向
284
|
第
16
章
实现版本可以自行定义除上述值以外的其他值来表示别的取近似值模式。如果实现
版本支持不同的取近似值模式,可以通过调用函数
fesetround ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

算法精讲视频课程:24篇系列讲座

算法精讲视频课程:24篇系列讲座

罗伯特·塞奇威克, 凯文·韦恩(Kevin Wayne)

Publisher Resources

ISBN: 9787111562207