Thread: Exceeding the limits

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    3

    Question Exceeding the limits

    Hello !

    I'm doing a program that eventully will be calculating big numbers , so big that even not __int64 can manage them. My program is running fine till i start exceeding the limits, then it starts to miss calculate. how can i fix this ? i have been trying to get gmp but i didnt understand to install that lol. i would really appriciate an example (source code) of how this can solved. well thanks in advance

  2. #2
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    I couldn't build it either and when I found a program that would build it I said "screw this" and downloaded a prebuilt one from http://www.cs.nyu.edu/exact/core/gmp/

    EDIT
    If your working with numbers larger then _int64, then there's prolly a pretty good chance that your program could use any speed boost that gmp may provide
    Last edited by MadCow257; 01-10-2005 at 05:13 PM.

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    3
    i still dont get how to install it lol

  4. #4
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    Assuming you are using Visual Studio downlod the static GMP library and header file for Visual C++ then
    Put gmp.h in c:/Program Files/Microsoft Visual Studio/VC98/include and gmp.lib in c:/Program files/Microsoft Visual Studio/VC98/lib I think you also put gmpdebug.lib there too
    Understand?

    EDIT
    O ya, when you go to build your source code
    you need to go to project/settings/link and add gmp.lib in the Object/library modules place
    Last edited by MadCow257; 01-10-2005 at 06:42 PM.

  5. #5
    Bob Dole for '08 B0bDole's Avatar
    Join Date
    Sep 2004
    Posts
    618
    you core store each digit in an int array for example

    4314134002 would be put into the array as follows

    big_number[0] = 4;
    big_number[1] = 3;
    big_number[2] = 1;
    big_number[3] = 4;
    big_number[4] = 1;
    big_number[5] = 3;
    big_number[6] = 4;
    big_number[7] = 0;
    big_number[8] = 0;
    big_number[9] = 2;

    or something like that, I'm pretty sure that would work. I could be having a day long brain fart though
    Hmm

  6. #6
    Rad gcn_zelda's Avatar
    Join Date
    Mar 2003
    Posts
    942
    Don't worry. It happens to the best of us *looks at Govtcheez*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Limits of C/C++
    By Abda92 in forum C Programming
    Replies: 4
    Last Post: 12-24-2007, 01:22 PM
  2. array limits in C++
    By mkapi in forum C++ Programming
    Replies: 5
    Last Post: 12-16-2004, 04:35 PM
  3. International Limits on Precision
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-20-2004, 06:32 AM
  4. data type limits
    By JTtheCPPgod in forum C++ Programming
    Replies: 7
    Last Post: 01-26-2003, 10:08 PM
  5. memory limits in console (win NT/9X)?
    By dp_goose in forum C++ Programming
    Replies: 1
    Last Post: 10-29-2002, 06:00 AM