Gradual underflow and denormalized numbers in IEEE

时光毁灭记忆、已成空白 提交于 2020-01-05 04:08:17

问题


I was reading about floating-point representation and underflow/overflow and I ecnountered something interesting - gradual underflow. As I understand gradual underflow means that the result of, for example substraction x-y is so small that it could be flushed to 0 but floating-point system produces number that is smaller then UFL. Everywhere I read that it is made by losing some precission, it means that some bits of mantissa goes to exponent so we can have smaller exponent?


回答1:


Effectively the answer is yes -- the bits of the mantissa go to the exponent. These are called subnormal (AKA denormal) numbers. For example, in IEEE double-precision, the smallest power of two exponent for a normal number -- a number with a full 53 bits of precision -- is 2-1022. But powers of two up to 2-1074 can effectively be represented, as dictated by the location of the first 1 bit in the unnormalized significand. So exponent 2-1023 has 52 bits of precision, 2-1024 has 51 bits of precision, ... , 2-1074 has 1 bit of precision.

(See my article What Powers of Two Look Like Inside a Computer to visualize this better.)



来源:https://stackoverflow.com/questions/8111307/gradual-underflow-and-denormalized-numbers-in-ieee

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!