Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Largest supported number(*,0) without rounding

user2695214Feb 23 2017 — edited Feb 24 2017

I've been trying to understand oracle's number data type and I can't seem to find a real answer to my question.

What I really want to know is this:  What is the largest number that oracle supports without rounding?

Based on the documentation: Max precision is 38.  So using number(38), oracle will guarantee 99999999999999999999999999999999999999 (38 digits).

But in practice I have used number(*).  I've added 40+ digit number and oracle does not seem to round the number.

In documentation: Oracle guarantees the portability of numbers with precision of up to 20 base-100 digits, which is equivalent to 39 or 40 decimal digits depending on the position of the decimal point.

This says to me, that oracle supports 20 digits, but '99' is counted as one digit (base 100 mean number 0..99 are all distinct digits).  So, oracle supports 9999999999999999999999999999999999999999 (40 digits)

In documentation: Oracle Database stores numeric data in variable-length format. Each value is stored in scientific notation, with 1 byte used to store the exponent and up to 20 bytes to store the mantissa.

20 bytes to store the mantissa tells me that oracle can support the number up to 2^20^8  which is 1.4 x10^48 (48 digits) or possibly 7.3x10^47 (47 digits) depending on if sign is also stored there.

Is there a simple answer to "What is the largest supported number(*,0) without rounding"?

Thanks.

This post has been answered by unknown-7404 on Feb 23 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 23 2017
Added on Feb 23 2017
9 comments
6,896 views