Jump to content

Extra Long Numbers?


spektormax
 Share

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?

Link to comment
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.

Link to comment
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)

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...