Re: Fixed Point Arithmetic
- From: Frank Hamersley <terabitemightbe@xxxxxxxxxxx>
- Date: Sat, 31 Mar 2007 01:18:02 GMT
David Cressey wrote:
"Gene Wirchenko" <genew@xxxxxxxx> wrote in message
news:58rn03pspoga5r87b0v632b4tmug00gq7f@xxxxxxxxxx
"David Cressey" <cressey73@xxxxxxxxxxx> wrote:the
[snip]
When it comes to the stock market, it depends on the country. AFAIK,NYSE still records stock "points" in units of dollars, with binaryTry again. Since 10 is evenly divisible by 2, you simply need
fractional points like 1/4, 1/32, and the like. The use of decimal FPs
with this kind of data will introduce round off problems that would have
been avoided with binary floating point numbers.
more precision. For example, 1/32 is exactly representable in decimal
as .03125.
Oops. It's my second turn to be embarrassed in just a week.
Don't be too embarrassed. Its true that the various fractions used for some (if not all) US stock quotations are rational there is still scope for your rounding issue to arise. This is because some instruments are quoted in 1/128ths and when settlement amounts are calculated parts of cents can arise depending on the number of lots traded etc. This is of course a trivial event.
Even though, here in Oz, we use decimal quotation depths in the case of Bonds the RBA specification actually describes the exact points where rounding is to be performed to eliminate confusion on the consideration for settlement.
Cheers, Frank.
.
- References:
- Fixed Point Arithmetic
- From: David Cressey
- Re: Fixed Point Arithmetic
- From: Gene Wirchenko
- Re: Fixed Point Arithmetic
- From: David Cressey
- Fixed Point Arithmetic
- Prev by Date: Re: Bidirectional Binary Self-Joins
- Next by Date: Re: Bidirectional Binary Self-Joins
- Previous by thread: Re: Fixed Point Arithmetic
- Next by thread: Re: Fixed Point Arithmetic
- Index(es):
Relevant Pages
|