473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Data types for extraordinarily large or long numbers, eg 10^1000000 or pi

This question is probably to complex to be answered quickly, but if you could even point me in the right direction that would be great! I am interested in knowing how to work with extremely large numbers, say like trying to find primes in excess of a million digits, or calculating pi to the billions of decimal places. Obviously even unsigned __int64 would be insufficient to process this (Never mind that I could not afford a computer capable of doing it in a reasonable amount of time). I would presume using a larger base number system would simplify things, but how would one write a program which calculates in base 16 or 32 rather than 10? Thanks for your help!

- Justin
Jan 31 '07 #1
3 1837
Ganon11
3,652 Expert 2GB
Hmm...writing a program to perform mathematics in hex...That would be very interesting.

I could imagine writing a class hexNumber that would hold an integer in string form, then overriding the operators for basic math by manipulating the hexNumbers classes.
Jan 31 '07 #2
RedSon
5,000 Expert 4TB
This question is probably to complex to be answered quickly, but if you could even point me in the right direction that would be great! I am interested in knowing how to work with extremely large numbers, say like trying to find primes in excess of a million digits, or calculating pi to the billions of decimal places. Obviously even unsigned __int64 would be insufficient to process this (Never mind that I could not afford a computer capable of doing it in a reasonable amount of time). I would presume using a larger base number system would simplify things, but how would one write a program which calculates in base 16 or 32 rather than 10? Thanks for your help!

- Justin
There should be a data structure in which you can define arbitrarily large numbers. If not you can just reserve a massive amount of memory and use a stream writer to save your number to that memory. As for arithmetic calculations, you will likely need to implement your own addition and subtraction algorithims.
Jan 31 '07 #3
RedSon
5,000 Expert 4TB
also please see http://www.answers.com/topic/arbitra...ion-arithmetic
Jan 31 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Stat | last post by:
Greetings all. I am writing a profile creator script where a user gets a URL invite in their mail in the form of; http://domain.com/profile-create.php?access_code=Ikd98jadf098asdf Things are...
12
by: jose luis fernandez diaz | last post by:
Hi, My OS is: cronos:jdiaz:tmp>uname -a HP-UX cronos B.11.11 U 9000/800 820960681 unlimited-user license I compile in 64-bits mode the program below:
3
by: LBHenning | last post by:
What is the best way to generate 10000+ and 1000000+ serial codes with a length of between 1 and 25 characters ?
6
by: James | last post by:
I am using vb.net and need to keep in memory a large data structure, so I am looking for the best option. And after several test I am pretty confused. So I will be grateful if anyone can help me. ...
22
by: Frinton | last post by:
Hi, I am trying to do some calculations on large numbers (ie 7,768,489,957,892,578,474,792,094 / 12,280) and no matter what I do it doesn't get it quite right. Its always somewhere between 10...
57
by: Chris Foote | last post by:
Hi all. I have the need to store a large (10M) number of keys in a hash table, based on a tuple of (long_integer, integer). The standard python dictionary works well for small numbers of keys,...
20
by: oswald.kluge | last post by:
Dear Reader, what efficient ways are there to OR two large memory regions? I'm especially interested in applying this operation to two large character arrays. I know memset and memcopy lets...
35
by: fermineutron | last post by:
For a while now i have been "playing" with a little C program to compute the factorial of large numbers. Currently it takes aboy 1 second per 1000 multiplications, that is 25000P1000 will take...
9
by: Cogito | last post by:
I would like to calculate factorial numbers that produce results of say 100 digits. What is the best way of doing it in Javascript? Can I define a variable and somehow have control on each of its...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.