Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Roundoff error question
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)?