最近在搞DSP,所以不可避免地会遇到浮点数,包括半精度浮点(16bit) 和单精度浮点(32bit)。
1、根据wiki百科介绍,IEEE 754规范中规定的32bit float point的格式为:(以下引用wiki百科https://en.wikipedia.org/wiki/Single-precision_floating-point_format)
- Sign bit: 1 bit
- Exponent width: 8 bits
- Significand precision: 24 bits (23 explicitly stored)
The real value assumed by a given 32-bit binary32 data with a given biased sign, exponent e (the 8-bit unsigned integer), and a 23-bit fraction is
which in decimal yields