You are invited to Log in or Register a free Frihost Account!

# Big Number Mathematics

bluffmango
PLz if any one has the code for a program in C++ that can add subtract multiply and divide big numbers like those consisting of 100 digits...............plz do send me i want it urgently plzzzz.......
01000101
yea, im looking for the same thing for either C/C++ or PERL.... ive got a precision integer calculator, but the prog languages wont interpret numbers of that magnitude (e+35), It will give me the sig fig value, like 4.2334e+34 and thats wayyyy to inaccurate for modulation.. i need this so that i can find the modulus when divided by another integer, but if its not perfectly accurate then it will be offset by quite a bit.... thats not good when messing w/ privateKeys & Hash's... Plz help!
01000101
ok, i found the PERL solution completely, all i had to do was add this one simple line

 Code: use bigint;

the c++ int size can be expanded a bit, by declaring
the integer as a

 Code: long long int variable = num
01000101
ok, i didnt find a "real" solution, but this works better actually..

this solution only limits integer sizes to the capicity of your memory.

here it is, go here and download the pack, and put ALL the files into your (include) folder for your compiler..

http://www.kepreon.com/~matt/bigint/index.html
TeenZine
I think this mite work PLEASE NOTE: because of coppyrights i think your required to keep the link to the site i got it on on it.
[quote="Java Script Source.com']
 Code:

Radians

Degrees

Binary

Decimal

[/quote]
01000101
ok thats great and all, nice little java proggie... but thats not what he asked for, he wants a function for C++ that can USE big integers... there are many freeware calculators that display large numbers, but C++ doesnt read them fully.. thats what the header file above does.
gecko
search google find something about GMP.

bcc is a great opensource calculator with (nearly) unlimited integers and more

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.