Re: numeric precision when raising one numeric to another. - Mailing list pgsql-general

From Dann Corbit
Subject Re: numeric precision when raising one numeric to another.
Date
Msg-id D425483C2C5C9F49B5B7A41F89441547055BCF@postal.corporate.connx.com
Whole thread Raw
In response to numeric precision when raising one numeric to another.  (Scott Marlowe <smarlowe@g2switchworks.com>)
Responses Re: numeric precision when raising one numeric to another.
List pgsql-general
Probably, the important meaningful cases are ones that have small
exponents (HOPEFULLY less than 25) used in interest calculations.

Million digit numbers are really only interesting in the field of pure
mathematics, since the number of elementary particles in the universe is
well under a googol (10^100).

But if someone has a billion dollars (and some do, of course -- even
potentially trillions if it is a government) and they want to do a long
term interest calculation accurate to the penny, then we should be
careful to get that answer right.

The calculation pow(huge,huge) will result in a big pile of fascinating
digits that won't really have much physical meaning.

> -----Original Message-----
> From: Martijn van Oosterhout [mailto:kleptog@svana.org]
> Sent: Thursday, May 19, 2005 2:48 PM
> To: Dann Corbit
> Cc: Alvaro Herrera; John Burger; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] numeric precision when raising one numeric to
> another.
>
> On Thu, May 19, 2005 at 02:25:58PM -0700, Dann Corbit wrote:
> > Hmmm....
> > I underestimated.
> >
> > pow(99999.99999,99999.99999) =
>
> Yeah, a number with x digits raised to the power with something y
digits
> long could have a length approximating:
>
> x * (10^y) digits
>
> So two numbers both 4 digits long can have a result of upto 40,000
> digits. You're only going to be able to them represent exactly for
> cases where y is small and integer.
>
> What's a meaningful limit? Do we simply say, you get upto 100 digits
> and that's it? Or an extra parameter so you can specify directly?
> --
> Martijn van Oosterhout   <kleptog@svana.org>
http://svana.org/kleptog/
> > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent
is a
> > tool for doing 5% of the work and then sitting around waiting for
> someone
> > else to do the other 95% so you can sue them.

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: numeric precision when raising one numeric to another.
Next
From: Hrishikesh Deshmukh
Date:
Subject: bulk loader