Re: [xsl] Rounding errors in financial app transforms

Subject: Re: [xsl] Rounding errors in financial app transforms
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 26 Jul 2007 14:16:59 +0100
> what's the recommended recipe to avoid rounding-error discrepancies
> in financial applications based upon XSLT (2.0) transforms?

using decimal rather than double would be a start.That's essentially
large precision arithmetic, although of course division is still a
problem.


On the other hand if you really want to emulate BCD arithmetic exactly
it's probably not too hard to come up with a set of xsl functions that
do that using integer internally. 

> My guess is that even having a standard MulDiv function in XSLT
> wuld help matters floating-point-wise but sadly there is no such
> animal available.

Not really thought about it, but if doing decimal or integer arithemtic
rather than double arithmetic, isn't muldiv the same as the naive
operation of doing the multiplication and then dividing?

David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread