Thread: data type long enough to store 2^64

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    137

    data type long enough to store 2^64

    I can't seem to find a data type that can store integers up to length 2^64. Can anyone point me in the right direction?

    Edit:

    Unsigned long long int works, but it seems to not be working with the modulus on other unsigned long long ints.
    Last edited by yahn; 10-16-2008 at 12:01 AM.

  2. #2

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by yahn View Post
    I can't seem to find a data type that can store integers up to length 2^64. Can anyone point me in the right direction?

    Edit:

    Unsigned long long int works, but it seems to not be working with the modulus on other unsigned long long ints.
    Probably depends on which compiler you are using. In gcc 3.4.5, it works fine to do x % y where x and/or y is a long long.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    There is always GMP.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. xor linked list
    By adramalech in forum C Programming
    Replies: 23
    Last Post: 10-14-2008, 10:13 AM
  3. Bitmasking Problem
    By mike_g in forum C++ Programming
    Replies: 13
    Last Post: 11-08-2007, 12:24 AM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  5. HUGE fps jump
    By DavidP in forum Game Programming
    Replies: 23
    Last Post: 07-01-2004, 10:36 AM