Re: Fixed Point Arithmetic

From: Frank Hamersley <terabitemightbe_at_bigpond.com>
Date: Sat, 31 Mar 2007 01:18:02 GMT
Message-ID: <eFiPh.6756$M.2226_at_news-server.bigpond.net.au>


David Cressey wrote:

> "Gene Wirchenko" <genew_at_ocis.net> wrote in message
> news:58rn03pspoga5r87b0v632b4tmug00gq7f_at_4ax.com...

>> "David Cressey" <cressey73_at_verizon.net> wrote:
>>
>> [snip]
>>
>>> When it comes to the stock market, it depends on the country. AFAIK,
> the

>>> NYSE still records stock "points" in units of dollars, with binary
>>> 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.
>> Try again. Since 10 is evenly divisible by 2, you simply need
>> 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. Received on Sat Mar 31 2007 - 03:18:02 CEST

Original text of this message