http://randomascii.wordpress/2012/01/23/stupid-float-tricks-2/
http://randomascii.wordpress/2012/01/23/stupid-float-tricks-2/
255*2^23+1 positive floats, from +0.0 to +infinity-----IEEE float format 指数部分255时,只能表示正无穷这个个有效float,其他的为无效浮点数字,所以只有一个有效的float point number
For double precision floats you could use _nextafter(x, y) to walk through all of the available doubles----定义好起始浮点数字0,依次循环,上次的结果,作为下一次循环的x
When going from zero to the smallest positive float or from FLT_MAX to infinity the ratio is actually infinite----代表浮点数字的“整型数字的值”增加,作者指出的是“浮点的值”的比率
I have discovered a truly remarkable proof of this theorem which this margin is too small to contain. ----------我发现了这定理的一个绝妙证明但这里的空白太小了,写不下。
in some ranges the exponent lines up such that we may (due to the wobble issues mentioned at the top) waste almost a full bit of precision,----浮点数的指数的编排,丧失1bit的精度, Ieee754 浮点表示格式,7位精度下 相对误差是x, 如果在某个区间,相对误差达到2x,则2进制表示方法中必然丧失1bit二进制数, 以前使用d个二进制bit,现在只有d-1个二进制bit了,相对误差增大2倍, 相当于把现有2进制的bit 权值扩大2倍,
第一,相对误差增大的exponent都在一个range后面,数值value比较大,相对误差会有变小的趋势
第二,不考虑exponent大的在一个range后面,exponent小的在range一个前面,将某个exponent扩展到整个range,认为此exponent下,尾数均匀分布在一个range中,采用这种
对比方式的话,能够推导出两种exponent需要多少个尾数bit 来表达这个range,进而可以推导出两种exponent下的相对误差的大小,在同一个range内,exponent大的相对误差肯定大于exponent较小的,因为ulp 即最小有效value本身就相差2倍,
The number of mantissa digits needed to exactly print the value of a negative power of two is about N-floor(N*log(2)/log(10)), or ceil(N*(1-log(2)/log(10))) where N is an integer representing how negative our exponent is---------试着进行证明这个公式,2e(-N) x 2e(N) x 10e(N) = 10e(N) 所以, 2e(-N) = 10e(N)/(2e(N) x 10e(N))
更多推荐
float point number
发布评论