Thread: 64-bit quantaties

  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    28

    64-bit quantaties

    What's "best" type to use to guarantee a 64-bit quantity? I know it's implementation and platform dependent, but is their any sort of de facto standard? I've seen int64_t, __int64, int64...

    Also, on a somewhat unrelated note, do 64-bit architectures generally supply primitive types longer than 64 bits?

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    28
    Answering my own question, it seems that int64_t is the correct choice, as of C99. Second question still stands, though.

  3. #3
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Quote Originally Posted by pdc
    Also, on a somewhat unrelated note, do 64-bit architectures generally supply primitive types longer than 64 bits?
    I suppose it all depends on the architecture, but FWIW...
    Registers

    The IA-64 architecture includes a very generous complement of registers: 128 each of 82-bit floating point and 64-bit integer registers.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  4. #4
    Registered User joed's Avatar
    Join Date
    Mar 2004
    Posts
    59
    I think "long long" is the long-long-winded, yet correct choice. Might as well typedef it away.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. 64 bit programs
    By learning in forum C++ Programming
    Replies: 17
    Last Post: 05-10-2007, 11:26 PM
  3. A Question About Unit Testing
    By Tonto in forum C++ Programming
    Replies: 2
    Last Post: 12-14-2006, 08:22 PM
  4. bit patterns of negtive numbers?
    By chunlee in forum C Programming
    Replies: 4
    Last Post: 11-08-2004, 08:20 AM
  5. Array of boolean
    By DMaxJ in forum C++ Programming
    Replies: 11
    Last Post: 10-25-2001, 11:45 PM