xsl-list
[Top] [All Lists]

Re: [xsl] Rounding errors in financial app transforms

2007-07-26 06:17:15


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. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--