Tag: float point

为什么在这个C代码中使用的IEEE-754指数偏差是126.94269504而不是127?

以下C函数来自fastapprox项目。 static inline float fasterlog2 (float x) { union { float f; uint32_t i; } vx = { x }; float y = vx.i; y *= 1.1920928955078125e-7f; return y – 126.94269504f; } 有些专家可以解释一下为什么上面代码中使用的指数偏差是126.94269504而不是127? 是否更准确的偏差值?