甲骨文银行家规则 [英] Oracle Bankers rule

查看:69
本文介绍了甲骨文银行家规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Oracle不使用银行家规则(四舍五入方法)?

Why Oracle is not using Bankers rule (the rounding method)?

推荐答案

准确的十进制算术是一个大而复杂的主题.

Accurate decimal arithmatic is a large and complex subject.

如果您想阅读有关该主题的Oracle,请使用Google的迈克·科利绍十进制舍入".

Google 'mike colishaw decimal rounding' if you want to read the ahem Oracle on the subject.

基本上,有许多可能的舍入方案:-

Basically there are many rounding schemes which are possible:-

四舍五入-包括C在内的大多数语言(包括Oracle)都是C语言编写的默认语言,这可能就是他们这样做的原因.

Round everthing down - the default in most languages including C as Oracle is written in C this is probably why they do this.

将所有内容整理整齐-很少见,但由于模糊的市场和税收规定,有时需要实施.

Round everything up - rarely seen but occasionally needs to be implemented because of obscure market and tax rules.

基本半舍入-大于.5的值将四舍五入,其他所有值均四舍五入.

Basic Half Rounding - anything above .5 rounds up everything else rounds down.

慷慨的半舍入-低于.5的任何内容均向下舍入,否则舍入.

Generous Half Rounding - anything below .5 rounds down everthing else rounds up.

银行家四舍五入-偶数遵循基本半舍入规则,奇数遵循慷慨的半舍入规则.在实际的银行中很少见到这种情况,它们更喜欢将钱四舍五入,而将钱转到客户手中时四舍五入.

Bankers Rounding - Even numbers follow the Basic Half Rounding rule, odd numbers the Generous Half Rounding rule. This is rarely seen in actual banks which prefer rounding up if the moneys coming thier way and rounding down when its going the clients way.

ORACLE NUMBER实际上是一个相当不错的Decimal Arithmatic实现,并且就它而言是准确的.

ORACLE NUMBER is actually a pretty good Decimal Arithmatic implementation and is accurate as far as it goes.

这篇关于甲骨文银行家规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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