[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Rounding errors in financial app transforms

Subject: Re: Rounding errors in financial app transforms
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 26 Jul 2007 15:38:35 +0100
Re:  Rounding errors in financial app transforms
> What's exactly is the problem with division 

multiplication you can always do, so long as you have enough precision
to hold the answer. 


Unless you are dividing by 2 you can't ever do division exactly. 1 / 10
is 0.1 and that just can't be stored in binary arithemetic to any finite
precision. So if you need to emulate BCD arithmetic _exactly_ you need
to do arithematic using exponents being powers of 10 rather than 2,
which means that you need to encode numbers as two integers, mantisa and
(base 10) exponent. But since your financial calculation may well be
going to finally round to only a couple of sp anyway, in all practical
cases you probably get more than enough accuracy using xsd:decimal.

David

> (coming a company called from The Numerical Algorithms Group) ...

Although actually before I started on this XML lark I was a pure
mathematician not a nuerical analyst. Working in finite fields is so
much easier (especially F_2 where you only have 0 and 1 to deal with:-)


________________________________________________________________________
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.