[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: Justin Johansson <procode@xxxxxxxxxx>
Date: Fri, 27 Jul 2007 00:25:12 +0900
Re:  Rounding errors in financial app transforms
David,

My apologies, I should have posed the question as,

"What exactly is the problem with division before I, AND OTHERS,
 go off thinking that all is home and hosed with xs:decimal?"

noting that there are many people who read the transactions of this list
without actively participating, such as people who are confused by
+ and - zero as demonstrated just a day or so ago.

Your answer provides insight to all, and best of all, in language
understood by everybody.

Thanks




At 03:38 PM 26/07/2007 +0100, you wrote:
>
>> 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. 
>________________________________________________________________________
>
>
>
Justin Johansson

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.