# Extra Long Numbers?

## Recommended Posts

so here is the idea, the maxmimum size of an intager (unsigned) is a long 32 bit intager (in c++ standard). Unfortuantly, that only gives you about 4 billion as your maximum number. NOw I wonder if its possible to use 2 long numbers together to create a large 64 bit intager (or 128 or 256...) basicly performing the noraml arithmitic operations with theses huge numbers....but how?

##### Share on other sites

I remember something like this in C#... I think it was a stack or something that's 64bit... I can't remember.

##### Share on other sites

in tradition C ther is "longlong" but nto in c++, in java theres liek a way whre it takes large numebrs and stores them as stirings. Being a semi-geek and only really knwoing C++ im sorta stuck with a stick up my ass.

##### Share on other sites

this is soooo your homework dude!

I had to do this in eiffel back in the day

##### Share on other sites

Computers (almost all) have 64bit mathematical coprocessor. You can use 64bit integers with "__int64". Limit of __int64 is 9,223,372,036,854,775,807.

example:

`__int64 bignum=6000000000000000613;`

##### Share on other sites

no not my hoemwork I just wanna do cools tuf likke finnachie or other studf it big hanking number

##### Share on other sites

Use GMP.

"GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers. There is no practical limit to the precision except the ones implied by the available memory in the machine GMP runs on. GMP has a rich set of functions, and the functions have a regular interface."

I've actually used this stuff some time ago and it's pretty damned good.

##### Share on other sites

Well there's another thing I learned about 32bit and 64bit numbers in C#. You shouldn't need to use more than 32bit!

##### Share on other sites

dude im construction liek the fibinachi seqence and golden rations, 32 bit is onyl about 4 billion in theroryt og et good results i need atleastliek 1024 bit float points to get a good and decent golden ration. I wonder how programs like pifast do it (no source)

##### Share on other sites

Well there's another thing I learned about 32bit and 64bit numbers in C#. You shouldn't need to use more than 32bit!

I would suggest that you find the guy that said that, walk up to him and say "Cooper told me to do this." after which you apply a particularly savage beating to him.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×