Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Precision in numbers

Re: Precision in numbers

From: Ed Bruce <Ed.Bruce_at_ha.hac.com>
Date: 1997/06/16
Message-ID: <33A5BBA8.6231@ha.hac.com>#1/1

Thomas Kyte wrote:
>
> On 3 Jun 1997 01:02:16 GMT, "Bruce Murphy" <murphbd_at_infinet.com> wrote:
>
> If you do all your math in pl/sql, select numbers into character strings only,
> you will get 38 digits of precision with no lose. the second you move it into a
> float/double/int/long, you may (will) loose precision (especially with
> floats/doubles as they support 10-13 digits of precision and can't represent all
> numbers).

The other problem is the different Oracle tools convert float/double/int/long using differnt procedures. We've even seen successive versions of a precompiler using different slightly different algorithms to convert numbers. So even though the values in our database didn't change and our code didn't change we started getting different results.

>
> >One thought we had was to use a text field and then use the conversion to
> >number, but I don't like this approach.

If you want to guarantee the precision and accuracy accross different platforms and interfaces this is not a bad option. If you are not concerned about portability of the data use a raw data type and store the numeric value directly. That way you control exactly how the data is represented.

> >
> >
> >Bruce Murphy
>
> Thomas Kyte
> tkyte_at_us.oracle.com
> Oracle Government
> Bethesda MD
>
> http://govt.us.oracle.com/ -- downloadable utilities
>
> ----------------------------------------------------------------------------
> Opinions are mine and do not necessarily reflect those of Oracle Corporation
 

-- 

Ed Bruce
<Bruce_at_ha.hac.com>
Received on Mon Jun 16 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US