*Magnify*
SPONSORED LINKS
Printed from https://www.writing.com/main/forums/message_id/3239878
Rated: E · Message Forum · Fantasy · #2016377
Chat with fellow members and catch up on all the FSFS News!
<< Previous  •  Message List  •  Next >>
Reply  •  Post New
Jan 4, 2019 at 10:27pm
#3239878
Multiplying massive numbers
by Zen
This is a little bit off-topic, but bear with me.

Computers perform calculations on numbers by first storing them on the CPU registers. The size of the register determines the maximum value. An 8-bit computer can only store numbers up to 255. Computing 250+10 results in an error.

64-bit computers can handle a value up to 18,446,744,073,709,551,615. You can get specialist software though, that can handle larger numbers, but this is usually expensive and specific to a certain task.

As a sci-fi writer, I'm constantly running into calculations that result in either complete failure or those dreaded e-numbers - e.g. 7.146e+19.

I recently came across a multiplication method developed in India 3,000 years ago. It is faster than long multiplication, only ever creates two interim results and creates them both at the same time. Even better, it produces the answer with the most significant digit first (it comes out last in long multiplication). If you're doing this on paper, you can begin reading out the answer before you've finished the calculation, which is pretty sweet.

I immediately realised this could be converted into an algorithm, so I did that and tested it on several 4-digit x 4-digit numbers. Then, just for fun, I tested it by multiplying two 4096 digit numbers. To store a 4096 digit number, you need 32,768 bits. There isn't a computer on the planet with registers that big, yet my humble desktop managed it fine.

So, now that my computer has acquired these god-like powers, what do I do with it? I work out the size of the diameter of the visible universe... in inches. It turns out to be 346,396,086,006,299,136,000,000,000,000 inches across.

So, why is this even remotely useful? If you remember my Orbital Calculator program, it allows you to calculate any viable orbit around any gravitational mass. Calculating the orbits of planets around a star is reasonably trivial. With this algorithm, I can now calculate the orbits of stars around the galactic centre of gravity, or even the orbit of the Milky Way around the gravitational centre of the Virgo cluster. Whoo-hoo!
MESSAGE THREAD
*Star*
Multiplying massive numbers · 01-04-19 10:27pm
by Zen
Re: Multiplying massive numbers · 01-06-19 6:19pm
by Derrol Edwards- Fantasy Writer
Re: Multiplying massive numbers · 01-07-19 1:58am
by Zen

The following section applies to this forum item as a whole, not this individual post.
Any feedback sent through it will go to the forum's owner, David the Dark one!.
Log in to Leave Feedback
Username:
Password: <Show>
Not a Member?
Signup right now, for free!
All accounts include:
*Bullet* FREE Email @Writing.Com!
*Bullet* FREE Portfolio Services!
Printed from https://www.writing.com/main/forums/message_id/3239878