什么是次正规浮点数?

What is a subnormal floating point number?(什么是次正规浮点数?)
本文介绍了什么是次正规浮点数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

isnormal() 参考页面说:

判断给定的浮点数 arg 是否正常,即是既不是零、次正规、无限,也不是 NaN.

Determines if the given floating point number arg is normal, i.e. is neither zero, subnormal, infinite, nor NaN.

很清楚数字为零、无限或 NaN 的含义.但它也说不正常.什么时候是次正规数?

It's clear what a number being zero, infinite or NaN means. But it also says subnormal. When is a number subnormal?

推荐答案

在IEEE754标准中,浮点数用二进制科学记数法表示,x = M × 2e.这里M尾数e指数.在数学上,您始终可以选择指数,以便 1 ≤ M < 2.* 但是,由于在计算机表示中,指数只能具有有限范围,因此是一些大于零但小于 1.0 × 2emin 的数字.这些数字是 subnormalsdenormals.

In the IEEE754 standard, floating point numbers are represented as binary scientific notation, x = M × 2e. Here M is the mantissa and e is the exponent. Mathematically, you can always choose the exponent so that 1 ≤ M < 2.* However, since in the computer representation the exponent can only have a finite range, there are some numbers which are bigger than zero, but smaller than 1.0 × 2emin. Those numbers are the subnormals or denormals.

实际上,尾数的存储没有前导 1,因为总是有前导 1,除了对于次正规数(和零).因此解释是,如果指数是非最小的,则有一个隐含的前导 1,如果指数是最小的,则没有,并且该数字是次正规的.

Practically, the mantissa is stored without the leading 1, since there is always a leading 1, except for subnormal numbers (and zero). Thus the interpretation is that if the exponent is non-minimal, there is an implicit leading 1, and if the exponent is minimal, there isn't, and the number is subnormal.

*) 更一般地说,1 ≤ M < B 对于任何基础-B 科学记数法.

*) More generally, 1 ≤ M < B  for any base-B scientific notation.

这篇关于什么是次正规浮点数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Rising edge interrupt triggering multiple times on STM32 Nucleo(在STM32 Nucleo上多次触发上升沿中断)
How to use va_list correctly in a sequence of wrapper functions calls?(如何在一系列包装函数调用中正确使用 va_list?)
OpenGL Perspective Projection Clipping Polygon with Vertex Outside Frustum = Wrong texture mapping?(OpenGL透视投影裁剪多边形,顶点在视锥外=错误的纹理映射?)
How does one properly deserialize a byte array back into an object in C++?(如何正确地将字节数组反序列化回 C++ 中的对象?)
What free tiniest flash file system could you advice for embedded system?(您可以为嵌入式系统推荐什么免费的最小闪存文件系统?)
Volatile member variables vs. volatile object?(易失性成员变量与易失性对象?)