help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

__int128_t assignment and printing


From: kmw
Subject: __int128_t assignment and printing
Date: Tue, 5 Feb 2008 08:04:24 -0800 (PST)
User-agent: G2/1.0

Hello,

I am playing around with big numbers in g++. The following code works
perfectly (on an AMD64):

#include <iostream>

int main ( int argc, char** argv )
{
  long int c = 1000000000000000000; // 1,000,000,000,000,000,000
  __int128_t d = 1000000000000000000; // 1,000,000,000,000,000,000

  std::cout << sizeof(c) << " " << sizeof(d) << std::endl;

  return 0;
}

That is, the output of this small programm is "8 16". But as soon as I
expand the 128bit integer, I end up with a warning telling me that the
integer is to large for its type.  What kind of suffix (something like
'LLU') do I have to add to mark the right hand side of the assignment
as 128bit integer? Is there a standard way to print such integers?

Best regards,
Kay


reply via email to

[Prev in Thread] Current Thread [Next in Thread]