spektormax Posted March 14, 2006 Share Posted March 14, 2006 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? Quote Link to comment Share on other sites More sharing options...
Neod101 Posted March 14, 2006 Share Posted March 14, 2006 I remember something like this in C#... I think it was a stack or something that's 64bit... I can't remember. Quote Link to comment Share on other sites More sharing options...
spektormax Posted March 14, 2006 Author Share Posted March 14, 2006 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. Quote Link to comment Share on other sites More sharing options...
wetelectric Posted March 14, 2006 Share Posted March 14, 2006 this is soooo your homework dude! I had to do this in eiffel back in the day Quote Link to comment Share on other sites More sharing options...
TonyBlack Posted March 14, 2006 Share Posted March 14, 2006 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; Quote Link to comment Share on other sites More sharing options...
spektormax Posted March 14, 2006 Author Share Posted March 14, 2006 no not my hoemwork I just wanna do cools tuf likke finnachie or other studf it big hanking number Quote Link to comment Share on other sites More sharing options...
cooper Posted March 15, 2006 Share Posted March 15, 2006 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. Quote Link to comment Share on other sites More sharing options...
Neod101 Posted March 15, 2006 Share Posted March 15, 2006 Well there's another thing I learned about 32bit and 64bit numbers in C#. You shouldn't need to use more than 32bit! Quote Link to comment Share on other sites More sharing options...
spektormax Posted March 15, 2006 Author Share Posted March 15, 2006 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) Quote Link to comment Share on other sites More sharing options...
cooper Posted March 15, 2006 Share Posted March 15, 2006 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.