[Banking-pm] What CPAN modules do you use?

IvorW ns7d-l3x0 at xemaps.com
Thu Aug 23 02:52:27 PDT 2007


Mark Blackman wrote:

> > On 23 Aug 2007, at 07:19, mike at wormers.net wrote:
> >
> >   
>   
>> >> Why use classes like BigFloat etc? Does it suggests a level
>> >> of accuracy beyond the model? i.e. 'double' should be sufficient? The
>> >> extra 'precision' probably isn't getting you a more accurate figure  
>> >> (does
>> >> depend on what exactly you are computing though I suppose).
>> >>     
>>     
> >
> > Well, in the current 'double' model if you need to know if two
> > sums agree (i.e. different calculations that should produce identical  
> > results)
> > results, you can't guarantee that unless you make a point of rounding
> > at key stages. Math::BigFloat (and bignum) free you from the requirement
> > to worry about rounding in your application, with some performance  
> > penalty.
> >
> > In any case, what I'm asking is, does anyone here on this list
> > need to care about this of agreement of two computations and what
> > do they tend to do about it? It's come up for me and the only two  
> > strategies
> > I identified were
> >
> > * pay attention to your computations and round (via sprintf) at  
> > obvious points
> > * delegate the whole problem to Math::BigFloat (or similar)
> >
> > the 'Accuracy' section of http://en.wikipedia.org/wiki/Floating_point
> > makes the point as well and the general problem that floating point
> > arithmetic in the IEEE754 standard is neither associative or  
> > distributive,
> > but you might very well assume that is.
> >   
>   
When banks are trading swaps, to the value of trillions of pounds,
notional, per annum, the rounding amounts could well become significant.

Organisations such as the FSA and ISDA do have written rules for
rounding, and it is up to the banks, brokers, exchanges and clearing
houses to follow the rules.

Some of my time at LCH was spent chasing rounding bugs. There were
particular counterparty banks that were more fussy than others. LCH did
use double precision float as their data type for storing monetary
values, much to my chagrin.


Ivor.




More information about the Banking-pm mailing list