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: Oracle internal NUMBER type

Re: Oracle internal NUMBER type

From: Dave <David.W.Spencer_at_elcaro.moc>
Date: Tue, 05 Nov 2002 11:35:48 +0000
Message-ID: <3DC7AD14.1000705@elcaro.moc>

Jaroslaw Gramacki wrote:
> On Tue, 5 Nov 2002 12:09:34 +0300, "Vladimir M. Zakharychev"
> <bob_at_dpsp-yes.com> wrote:
>
>

>>Different processors implement floating-point arithmetic differently.
>>Besides, Oracle may be ran on a platform with no FPU unit whatsoever.
>>At the same time, Oracle guarantees portability of values with precision
>>up to 38 decimal digits across all supported platforms. No wonder they
>>implemented floating-point math that way...
>>

>
> OK, but ...
> Say you have a looooot of data in your database and need to perform
> math intensive calculations on them.
> What would be better - perform all math (algorithms) in e.g pl/sql or
> outside oracle in e.g C language but in the latter you are thrown back
> on float, double or long double.
> And what if you perform some calculations in oracle and some outside?

PL/SQL is well optimised for database access but not for number crunching, although native compilation partially addresses this. There are a variety of ways you can proceed; you can write a Pro*C or OCI program, or use a Java Stored Procedure as Java is better suited to number crunching than PL/SQL, or use external procedures to perform the maths.

There are a variety of high precision libraries available for C that will be able to handle the precision within Oracle. The basic data types are not sufficient (and it's not just the FP stuff - an int can't hold a NUMBER, although a 128 bit data type, if you've got one, can hold 10^38.)

Dave.

-- 
Email address munged to avoid SPAM
Reverse the last two parts to reply directly
Received on Tue Nov 05 2002 - 05:35:48 CST

Original text of this message

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