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: Roundoff error question

Re: Roundoff error question

From: Don Del Grande <delgrandedp_at_navsea.navy.mil>
Date: 27 Oct 2005 09:21:56 -0700
Message-ID: <1130430116.910232.253320@g43g2000cwa.googlegroups.com>


Mark D Powell wrote:
> I have added a select after each update. The difference is where you
> have .09.. in your calculations the query shows a value of 1.
>
> UT1 > CREATE TABLE roundoff_error (N NUMBER);
> UT1 > INSERT INTO roundoff_error(N) values(1/190);
> UT1 > UPDATE roundoff_error SET N = N * 10;
> UT1 > SELECT * FROM roundoff_error;
>
> N
> --------------------------------------
> .0526315789473684210526315789473684211

At this point, I get:
0.0526315789473684210526315789473684210526 (I used numwidth 50 to make sure I got all of the digits)

Now I see where ORACLE is getting -6 x 10^(-40). However, I don't understand where the 39th significant digit is coming from - I thought ORACLE only maintained 38 significant digits in NUMBERs.

Can anybody tell me why there are 39 significant digits? Is this a "hidden feature" of some sort of ORACLE where it will maintain a 39th digit if the first digit in the first stored byte is zero (so it would use 20 bytes in the mantissa - otherwise only 37 significant digits would be maintained)?

Received on Thu Oct 27 2005 - 11:21:56 CDT

Original text of this message

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