ROUND_HALF_EVEN 在一系列计算中重复应用时,为什么以及如何最小化累积误差? [英] Why and how does ROUND_HALF_EVEN minimize cumulative error when applied repeatedly over a sequence of calculations?

查看:36
本文介绍了ROUND_HALF_EVEN 在一系列计算中重复应用时,为什么以及如何最小化累积误差?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人告诉我 ROUND_HALF_EVEN 是财务数据计算的首选舍入模式.我很想知道这种舍入模式为什么以及如何减少 javadoc BigDecimal 1.4.2 中所述的累积误差.谢谢,院长

I am told that ROUND_HALF_EVEN is the favored rounding mode for financial data calculations. I am curious to know why and how this rounding mode would reduce the cumulative error as stated in javadoc BigDecimal 1.4.2. Thanks, Dean

推荐答案

来自 维基百科:

尽管有四舍五入的习惯数字 4.5 到 5,实际上 4.5 是没有比 4 更接近 5(它是 0.5远离两者).处理的时候大量的科学或统计数据,其中趋势是重要的,传统的四舍五入平均使数据向上偏移轻微地.在大量数据上,或当许多后续四舍五入操作像在数字中一样执行信号处理,舍入到偶数规则趋于减少总数舍入误差,(平均)一个数字的相等部分四舍五入作为四舍五入.这一般减少结果的向上倾斜.

Despite the custom of rounding the number 4.5 up to 5, in fact 4.5 is no nearer to 5 than it is to 4 (it is 0.5 away from both). When dealing with large sets of scientific or statistical data, where trends are important, traditional rounding on average biases the data upwards slightly. Over a large set of data, or when many subsequent rounding operations are performed as in digital signal processing, the round-to-even rule tends to reduce the total rounding error, with (on average) an equal portion of numbers rounding up as rounding down. This generally reduces upwards skewing of the result.

这篇关于ROUND_HALF_EVEN 在一系列计算中重复应用时,为什么以及如何最小化累积误差?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆