Controlling rounding in financial functions

Unlike other numeric operations in ACL, financial functions are evaluated using floating-point arithmetic.

Floating-point arithmetic affects your calculations in two ways:

In financial functions, you often divide interest rates by constants such as 12 or 365, to create monthly or daily interest rates. For example, 0.08/365 gets the daily interest factor based on 8% per annum. The normal ACL rules for division would result in significant rounding errors in most situations. For example, 0.08/365 will result in an interest rate of 0.00, instead of the actual rate of 0.000219178. For this reason, the normal division rules are suspended when evaluating interest rate parameters.

When the interest rate parameter in a financial function is the division of two quantities (for example, 0.08/365), then the two quantities are evaluated separately. They are then divided, maintaining the full precision of the result. Each of the two sides are still evaluated using the standard ACL rules for rounding, so in the case of very complex calculations, this solution may still not provide total protection from rounding errors.

When the interest rate is neither a specific rate, nor the division of two simple quantities, (for example, 08/1/365) then a warning message is included in the log (and displayed in an alert dialog, if not in script mode) warning that rounding may have affected the interest rate calculation. When this occurs, you should ensure that the result returned has not been rounded excessively.

When the interest rate is calculated in a computed field, ACL cannot determine whether the rate has been rounded, so you must ensure that the result is correct.

Related concepts
Controlling rounding in numeric expressions
Avoiding overflow errors in numeric expressions


(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback