什么是HALF_EVEN四舍五入? [英] What is HALF_EVEN rounding for?

查看:591
本文介绍了什么是HALF_EVEN四舍五入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法想象我需要在Java中使用 RoundingMode.HALF_EVEN 的情况。

I can not imagine a situation that I need to use RoundingMode.HALF_EVEN in Java.

什么是这个舍入模式为?
我想什么时候使用它?

What is this rounding mode for? When do I want to use it?

请给我一些真实世界的例子。

Please give me some real world examples.

推荐答案

当您执行多个舍入操作并希望累积结果为真正的平均值,而不是像HALF_UP或HALF_DOWN一样向上或向下倾斜时,它非常有用。

It is useful when you are performing multiple rounding operations and want the cumulative result to be a true average, and not skewed up or down, as it would be with HALF_UP or HALF_DOWN.

具体来说,它对统计分析很有用(您不希望非随机平均系统污染结果)或任何需要随机平均的情况。

Specifically, it is useful for statistical analysis (you don't want the results polluted by a non-random averaging system) or any situation where you want random averaging.

这篇关于什么是HALF_EVEN四舍五入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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