Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Storing real *large* integer values - ideas?
In article <5a1o1r$4a8_at_nnrp1.news.primenet.com>,
K Fein <kfein_at_primement.com> wrote:
>All,
>
>Any ideas for representing large integer values within ORACLE7's
>datatypes? Say, 10 times larger than a numeric(40)...
A number 10 times larger than a numeric 40 is a numeric 41. You may have meant a number 10 orders of magnitude greater than 40 which is 50 or 10 times the magnitude which would be 400.
>Ideas for storing
>values in another base, say, base(256) or base(32767) or...??? Of
>course, the translation to base(10) could be a pl/sql procedure but I'd
>like to index the value(s) because this is the unique identifier for
>the record.
IEEE 64 bit floating point (industry standard) is +/- e100 (if memory serves). This would be only 25% of the 400 you may need.
If you implement your own floating point you will need a sign, an exponent, and a characteristic. 1 digit for sign 3 digits for exponent and 38 digits for characteristic would solve you e400 issue.
The only thing is that implementing your own floating point arithmetic is not for the faint of heart. Things like normal vs non normal numbers and precision of 2 38 digit numbers when you only have 38 digit math is to see the least non trivial.
You might wish to explore other options like changing the units from dollars to megadollars or what seems most appropriate.
Hope this helps
Mark Rosenbaum Otey-Rosenbaum & Frazier, Inc. mjr_at_netcom.com Consultants in High Performance and (303) 727-7956 Scalable Computing and Applications POB 1397 ftp://ftp.netcom.com/pub/mj/mjr/resume/Boulder CO 80306 Received on Sat Dec 28 1996 - 00:00:00 CST