Re: Fixed Point Arithmetic
- From: "David Cressey" <cressey73@xxxxxxxxxxx>
- Date: Fri, 30 Mar 2007 13:52:02 GMT
"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 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.
[snip]
Are fixed point numbers a useful from for DBMSes to support?
Of course, since they often deal with such numbers. Currency
amounts are almost certainly the most common example.
Thanks. I really liked Oracle's Number (X,2) when I first saw it. And I
don't really care if the arithmetic is a little slow, as long as it's right.
If you're doing some heavy duty arithmetic, like interplanetary trajectory
calculations, don't use the facilities of a DBMS. And learn what you're
doing before doing it.
.
- Follow-Ups:
- Re: Fixed Point Arithmetic
- From: Frank Hamersley
- Re: Fixed Point Arithmetic
- From: Bob Badour
- Re: Fixed Point Arithmetic
- References:
- Fixed Point Arithmetic
- From: David Cressey
- Re: Fixed Point Arithmetic
- From: Gene Wirchenko
- Fixed Point Arithmetic
- Prev by Date: Re: Bidirectional Binary Self-Joins
- Next by Date: Re: Fixed Point Arithmetic
- Previous by thread: Re: Fixed Point Arithmetic
- Next by thread: Re: Fixed Point Arithmetic
- Index(es):