非规格化数字(denormalized numbers)

本文详细解释了计算机科学中浮点运算中次正常数的概念,包括其定义、表示方式以及与正常数的区别。阐述了次正常数如何填补接近零的下溢区间,以及它们在不同情况下对计算精度的影响。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

In computer science, denormal numbers or denormalized numbers (now often called subnormal numbers) fill the underflow gap around zero in floating point arithmetic: any non-zero number which is smaller than the smallest normal number is 'sub-normal'.

 
In a normal floating point value there are no leading zeros in the significand, instead leading zeros are moved to the exponent. So 0.0123 would be written as 1.23 * 10-2. Denormal numbers are numbers where this representation would result in an exponent that is too small (the exponent usually having a limited range). Such numbers are represented using leading zeros in the significand.
在正常的浮点数中, 有效数部分开头的不是0,0被移动到指数部分去了,比如0.0123会被表示为1.23*2-2。Denormal numbers就是指数部分非常小的数字。这些数字的有效数部分首位用0来表示。


The significand (or mantissa) of an IEEE number is the part of a floating point number that represents the significant digits. For a positive normalised number it can be represented as m0.m1m2m3...mp-2mp-1 (where m represents a significant digit and p is the precision, and m0 is non-zero). Notice that for a binary radix, the leading binary digit is one. In a denormal number, since the exponent is the least that it can be, zero is the lead significand digit (0.m1m2m3...mp-2mp-1) in order to represent numbers closer to zero than the smallest normal number.
 
By filling the underflow gap like this, significant digits are lost, but not to the extent as when doing flush to zero on underflow (losing all significant digits all through the underflow gap). Hence the production of a denormal number is sometimes called gradual underflow because it allows a calculation to lose precision slowly when the result is small.
 
In IEEE 754-2008, denormal numbers are renamed subnormal numbers, and are supported in both binary and decimal formats. In binary interchange formats, subnormal numbers are encoded with a biased exponent of 0, but are interpreted with the value of the smallest allowed exponent, which is one greater (i.e., as if it were encoded as a 1). In decimal interchange formats they require no special encoding because the format supports unnormalized numbers directly.

 

 

Some implementations of VFP use support code to handle denormalized numbers. The performance of such systems, in calculations involving denormalized numbers, is much less than it is in normal calculations.

Flush-to-zero mode replaces denormalized numbers with 0. This does not comply with IEEE 754 arithmetic, but in some circumstances can improve performance considerably.

NEON and VFPv3 flush-to-zero preserves the sign bit. VFPv2 flush-to-zero flushes to +0.

NEON always uses flush-to-zero mode.

转载于:https://www.cnblogs.com/whyandinside/archive/2012/05/11/2496552.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值