Re: [xsl] Rounding errors in financial app transforms

Subject: Re: [xsl] Rounding errors in financial app transforms
From: Justin Johansson <procode@xxxxxxxxxx>
Date: Thu, 26 Jul 2007 23:05:15 +0900
Hi David,

>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?

MulDiv, as, for example the Windows API function,

"The MulDiv function multiplies two 32-bit values and then divides the
64-bit result by a third 32-bit value.
The return value is rounded up or down to the nearest integer."

So the intermediate product has double the precision of the original
arguments.

There would still be a case to have a MulDiv in XSLT/XPath for SVG
applications.
Hard-core GUI developers use it all the time.

Cheers
Justin Johansson

*** A horse with no name is called Lambda ***

Current Thread