How do I multiply numbers?

R

reckyroo

Hi
I haven't used excel for a long time and can't remember how to so much at all!
I need to start with a number 1, multiply it by 2, then multiply that answer
by 2, multiply that answer by 2 and carry on multiplying my answers by 2
until I have done this 480 times. The answers that excel is throwing out is
either as a decimal which is rounding it up and not giving a true answer, or
the answer I get is 4.72237E+21 (which doesn't mean anything at all to me i'm
afraid!)!
Can anybody help me to get a true calculation, without rounding up etc?
Any help would be much appreciated.
Thanks
 
F

Fred Smith

4.722371E+21 is 4.7 followed by 21 zeros, ie,
4,700,000,000,000,000,000,000,000,000.

You should expect a number this large if you are multiplying 2 by itself 480
times.

You can also simplify things greatly by using exponentiation. The formula

=2^480

will give you your answer. It's 3.1E144, so while your calculation was close,
you missed out on a few 2's.
 
D

David Biddulph

4.722371E+21 is 4.7 followed by 21 zeros, ie,
4,700,000,000,000,000,000,000,000,000.

You should expect a number this large if you are multiplying 2 by itself
480 times.

You can also simplify things greatly by using exponentiation. The formula

=2^480

will give you your answer. It's 3.1E144, so while your calculation was
close, you missed out on a few 2's.

Missed more than a few, Fred.
4.722371E+21 is 2^72, rather than 2^480
[Note that your example showed 4.7E27, not 4.7E21]

The OP needs to realise that there will be rounding in a calculation as long
as this. Excel works to 15 significant figures, not the 145 figures that
this would need.
 
D

Dana DeLouis

2^480
Here's the answer. This took 0.3 seconds with Excel vba calling the ATP.
It's much faster if you use your own routines.
2^480 =
3121748550315992231381597229793166305748598142664971150859156959625371738819765620120306103063491971159826931121406622895447975679288285306290176
 
D

David Biddulph

Here's the answer. This took 0.3 seconds with Excel vba calling the ATP.
It's much faster if you use your own routines.
2^480 =
3121748550315992231381597229793166305748598142664971150859156959625371738819765620120306103063491971159826931121406622895447975679288285306290176

Interesting! Could you please expand a little on how you did this? I
hadn't realised that one could bypass Excel's 15 significant figure limit.
 
D

Dana DeLouis

Could you please expand a little on how you did this? I hadn't realized
that one could bypass Excel's 15 significant figure limit.

Hi. Excel can not do this directly. I used a rather short vba code to do
this.
To make the code simple, I used Excel's Fourier Transform in the ATP for all
the hard work.
I wanted to make only one pass with the code, but the 480 number is rather
on the limit without using advanced techniques. We note that Excel won't be
able to directly do what I call a 60*8 in the frequency domain. However,
Excel can do a 80*6. Therefore, we let Excel do as much of the hard work
directly as possible. First, find 2^80 in the time domain.

Sub Demo()
Dim n, ans
n = 80
ans = (CDec(0) + 2 ^ 48) * (2 ^ (n Mod 48))
Debug.Print "2^80 = "; FormatNumber(ans, 0, , , vbTrue)
End Sub

2^80 = 1,208,925,819,614,629,174,706,176

That should answer your 15 digit question.
We then take the Fourier Transform...etc
Anyway...Hope this helps in some way. :>)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top