Thread: Number larger than 1410065389

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    45

    Number larger than 1410065389

    I'm trying to make a program that can handle numbers up to 9999999999, but 1410065389 seems to be my limit.

  2. #2
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    Try using long long...it will more than suffice...
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    I can't imagine any representation where 1410065389 is the limit of an integer. If you're using a signed 32-bit integer, the maximum is probably 2147483647.

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Sounds like you have a stranger bug. Are you allocating that much memory? Perhaps that's all that your system has free. Or maybe you have a buffer overrun somewhere, or another type of memory error. Could you post your code?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ thread inside a class hang issue
    By diefast9 in forum C++ Programming
    Replies: 11
    Last Post: 10-21-2009, 07:18 AM
  2. Need help with this compiler error
    By Evangeline in forum C Programming
    Replies: 7
    Last Post: 04-05-2008, 09:27 AM
  3. Logical errors with seach function
    By Taka in forum C Programming
    Replies: 4
    Last Post: 09-18-2006, 05:20 AM
  4. Prime number program problem
    By Guti14 in forum C Programming
    Replies: 11
    Last Post: 08-06-2004, 04:25 AM
  5. parsing a number
    By juancardenas in forum C Programming
    Replies: 1
    Last Post: 02-19-2003, 01:10 PM