Liste des Groupes | Revenir à col misc |
It appears that Pancho <Pancho.Jones@protonmail.com> said:I suppose you might have explicit rules to round annual interest rates to monthly coupon periods. I worked most of my life in banks, valuing financial instruments. We never used decimals, but to be fair I never worked on settlement systems.On 3/3/25 03:05, John Levine wrote:It's not just having enough precision, it's getting the decimal rounding to do
>That required simulating decimal>
rounding with binary arithmetic, which was quite painful. If DFP makes it
easier to get correct rounding on zillion dollar financial calculations it
could well be worth the cost.
Why? Double precision gives you 15 digits.
the right thing with whatever number of digits the spec says. Sometimes it's
pennies, two digits after the decimal point, but sometimes it's something like
the the nearest 1/100 of a percent which would be four digits after the decimal
point.
For financial calculations, the right answer often isn't the mathematically most
accurate one, it's the one that agrees with the result that all the other people
doing financial calculations get. In some cases like bond pricing the formulas
date back to the 1920s or 1930s and were designed to be tractable with pencil
and paper or a mechanical desk calculator. They often have strange
simplifications like pretending every month has 30 days and the year has 360
days. They're defined in terms of decimal arithmetic, which is why DFP, which
unlike BFP lets you say how many digits you want to keep, is useful.
Les messages affichés proviennent d'usenet.