Results 1 to 8 of 8

100707, 10:37 #1Registered User
 Join Date
 Oct 2007
 Posts
 2
Unanswered: Large numbers! Need help,quickly.
I have problem. I need to do a multiplication of to large numbers(about 150 digits). But I don't know which way I could do it. Could you help me?
Thanx for help.

100707, 11:47 #2Registered User
 Join Date
 Aug 2003
 Location
 Where the Surf Meets the Turf @Del Mar, CA
 Posts
 7,776
Provided Answers: 1Never, say "never".
AFAIK, Oracle can not handle 150 digits.
All I can say is that any such requirement is totally daft & smells like a homework assignment.You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Good judgement comes from experience. Experience comes from bad judgement.

100707, 12:05 #3Registered User
 Join Date
 Oct 2007
 Posts
 2
I know that there is no such dataType. So I ask you, how I can solve this problem.
Now I've done this with varchar typeand dividing it by char and then converting it to number. But I don't like this way.. I this there could be better way

100707, 13:44 #4Moderator.
 Join Date
 Sep 2002
 Location
 UK
 Posts
 5,171
Provided Answers: 1Since Oracle's NUMBER datatype cannot handle 150 digit numbers, I don't see how you can do better than using the VARCHAR method you apparently already have. Why doesn't Oracle support 150digit numbers? Because they are of no practical use to 99.999% of its users! You apparently represent the 0.001% who could find a use for them.
Tony Andrews
http://tinyurl.com/tonyandrews

100707, 14:09 #5SQL Consultant
 Join Date
 Apr 2002
 Location
 Toronto, Canada
 Posts
 20,002
why not use FLOAT
the answer that you get by multiplying two 150digit numbers is so gargantuan that FLOAT will be close enough for any real world application
i agree, this smells like homework (especially the "need help quickly" part  sounds like it's due on monday)

100707, 14:25 #6Registered User
 Join Date
 Aug 2003
 Location
 Where the Surf Meets the Turf @Del Mar, CA
 Posts
 7,776
Provided Answers: 1>why not use FLOAT
HUH?
from http://download.oracle.com/docs/cd/B...1.htm#sthref80
Code:NUMBER Datatype The NUMBER datatype stores zero as well as positive and negative fixed numbers with absolute values from 1.0 x 10130 to (but not including) 1.0 x 10126. If you specify an arithmetic expression whose value has an absolute value greater than or equal to 1.0 x 10126, then Oracle returns an error. Each NUMBER value requires from 1 to 22 bytes. Specify a fixedpoint number using the following form: NUMBER(p,s) where: p is the precision, or the total number of significant decimal digits, where the most significant digit is the leftmost nonzero digit, and the least significant digit is the rightmost known digit. Oracle guarantees the portability of numbers with precision of up to 20 base100 digits, which is equivalent to 39 or 40 decimal digits depending on the position of the decimal point. s is the scale, or the number of digits from the decimal point to the least significant digit. The scale can range from 84 to 127. Positive scale is the number of significant digits to the right of the decimal point to and including the least significant digit. Negative scale is the number of significant digits to the left of the decimal point, to but not including the least significant digit. For negative scale the least significant digit is on the left side of the decimal point, because the actual data is rounded to the specified number of places to the left of the decimal point. For example, a specification of (10,2) means to round to hundreds.
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Good judgement comes from experience. Experience comes from bad judgement.

100707, 14:33 #7SQL Consultant
 Join Date
 Apr 2002
 Location
 Toronto, Canada
 Posts
 20,002
no, but you can get really close!!
for example, what is the percentage difference between the following two numbers:
1)
45,879,863,215,874,514,853,258,795,547,893,025,854 ,236,982,021,748,510,254,785,411,004,585,511,254,5 21,134
2)
4.587986321587451485325879554 * 10**79

100707, 14:54 #8Registered User
 Join Date
 Aug 2003
 Location
 Where the Surf Meets the Turf @Del Mar, CA
 Posts
 7,776
Provided Answers: 1>no, but you can get really close!!
"close" is a relative term.
15079=71
if you consider a difference of 10**71 as being close, I want you as my banker & paying ME the difference between 10**79 and 10**150!
BTW, I'd still would like to hear the Business justification for using/requiring a 150 digit number; regardless of where the decimal point is placed.You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Good judgement comes from experience. Experience comes from bad judgement.