Handling Large Numbers

This is a discussion on Handling Large Numbers within the C Programming forums, part of the General Programming Boards category; When you need to handle a number in a program that is larger than any built in datatypes allow (in ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 12: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, 11:01 AM
  4. commas in large numbers
    By HKR in forum C Programming
    Replies: 7
    Last Post: 03-06-2002, 06:08 PM
  5. A (complex) question on numbers
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 02-03-2002, 05:38 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21