Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Possreps and numeric types
"Marshall" <marshall.spight_at_gmail.com> wrote in message
news:1174863816.647794.146930_at_d57g2000hsg.googlegroups.com...
> On Mar 25, 1:30 pm, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
> > Marshall wrote:
> >
> > > So what if we had an internal representation for
> > > integer similar to java.math.BigInteger, and an
> > > internal representation for rational that was a pair
> > > of integers. We can define *exact* operators for
> > > these types for basic arithmetic functions.
> >
> > I disagree. Unless one has infinite precision, rational is
> > always an approximation.
>
> "Approximation" is perhaps not the best choice of words.
> We certainly have resource limits in our finite computers.
> There are computations that we can't do because
> we don't have the resources. For example, a computer
> might be able to add together two one billion digit
> integers, but not be able to add together two ten billion
> digit integers because it didn't have enough memory.
> That doesn't mean the result of adding the two
> one billion digit integers is approximate; on the
> contrary, it is precise and exact. Or consider
> java.util.BigInteger. Any answer you get from it
> will be precise, and it can handle up to four
> billion digit numbers. If it can't give you an answer,
> it'll fail in a way that can't be mistaken for an
> answer.
>
I disagree with Bob. If pairs of integers are used to represent rationals,
rational(N,M) = N/M,
Then any rational can be represented exactly (not an approximation) within
the scheme, provided that N and M can both be represented within the
scheme.
If the representation scheme for integers is indefinitely extensible, then the field of rationals representable is likewise indefinitely representable. Common decimal notation of integers is indefinitely extensible. There are other schemes.
In any finite computer, it is only possible to actually represent a finite subset of the integers, and thus it is only possible to represent exactly a finite subset of the rationals. The problem is that the finite subset of rationals will not, in general, exhibit closure under addition. Thus one is forced into the realm of approximation as soon as one begins to store the results of arithmetic computation. Received on Mon Mar 26 2007 - 05:39:59 CDT