首页>
外国专利>
Methods and arrangements to correct for double rounding errors when rounding floating point numbers to nearest even
Methods and arrangements to correct for double rounding errors when rounding floating point numbers to nearest even
展开▼
机译:将浮点数四舍五入到最接近偶数时纠正双舍入错误的方法和装置
展开▼
页面导航
摘要
著录项
相似文献
摘要
Methods and arrangements to correct for double rounding errors when rounding floating point numbers to nearest even are described. Embodiments include transformations, code, state machines or other logic to perform a floating point operation on one or more floating point numbers of precision P1 in base b, producing positive result res0 of precision greater than precision P1; rounding positive result res0 to precision P1 to the nearest even, producing positive result res1; and rounding the result res1 to precision P2 to the nearest even, where P2 is narrower than P1, producing result res2. The embodiments may also include correcting res2 for double rounding errors. The correcting may include determining that res1 is midway between two consecutive floating point numbers of precision P1, the larger (smaller) being res2, determining that rounding res0 to produce res1 involved rounding up (down), and decrementing (incrementing) the significand of res2 to obtain the corrected result res2′. 展开▼