仅仅是强行规定吗?
|
starfishAug 15, 2014
1
本来想直接给你解释,但写了一大堆东西后发现解释起来比较麻烦,所以请自行参考下列网页:
http://en.wikipedia.org/wiki/Binary32 http://babbage.cs.qc.cuny.edu/IEEE-754.old/References.xhtml |
|
bcxxAug 15, 2014
2
额你 e 是 8 位那肯定是 127 啊……(为啥是 127 这个就要解释移码这玩意的作用了
|
|
bcxxAug 15, 2014
5
@hazard 是 2^(n - 1) - 1 啦 http://en.wikipedia.org/wiki/Exponent_bias
> By arranging the fields so that the sign bit is in the most significant bit position, the biased exponent in the middle, then the mantissa in the least significant bits, the resulting value will be ordered properly, whether it's interpreted as a floating point or integer value. This allows high speed comparisons of floating point numbers using fixed point hardware. 大概用这句就能解释了吧? |
|
6
@bcxx 你认为是保持符号位?进行快速比较?
但比如阶码真值为0000 0000 加了127后是 0111 1111 而若阶码真值为 0000 0001 加了127 之后是 1000 0000 还是要要减了127后才能比较大小啊。。。否则一个负数怎么会比一个正数大呢? |