xsl-list
[Top] [All Lists]

Re: [xsl] Rounding errors in financial app transforms

2007-07-26 06:35:40
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 ***

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