Thread: Handling Large Numbers

  1. #1
    Registered User Xzyx987X's Avatar
    Join Date
    Sep 2003
    Posts
    107

    Handling Large Numbers

    When you need to handle a number in a program that is larger than any built in datatypes allow (in my case a 64bit unsigned integer) what's the best way to go about it?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well some compilers have __int64
    some other compilers have long long int

    If you want to go larger still (or your compiler has neither of those), then tryGMP
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User Xzyx987X's Avatar
    Join Date
    Sep 2003
    Posts
    107
    Thankfully my compiler does in fact support __int64. I would've really dissliked having to add a huge library to my program for the extremely limited use I'd have for it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need simple code for large file handling
    By spiit231 in forum C Programming
    Replies: 4
    Last Post: 02-27-2008, 01:05 AM
  2. how to deal wth large numbers
    By bvgsrs in forum C++ Programming
    Replies: 2
    Last Post: 06-18-2007, 06:16 AM
  3. Help needed with VERY large numbers.
    By jwarner in forum C++ Programming
    Replies: 4
    Last Post: 01-18-2004, 12:01 PM
  4. commas in large numbers
    By HKR in forum C Programming
    Replies: 7
    Last Post: 03-06-2002, 07:08 PM
  5. A (complex) question on numbers
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 02-03-2002, 06:38 PM