https://github.com/root-project/root
Raw File
Tip revision: acd3421529a27c622591d2937fc47d32abdb593f authored by Fons Rademakers on 18 April 2012, 14:23:18 UTC
tag special version for ALICE (tag of trunk @43767).
Tip revision: acd3421
longlong.cxx
/* -*- C++ -*- */
/*************************************************************************
 * Copyright(c) 1995~2005  Masaharu Goto (cint@pcroot.cern.ch)
 *
 * For the licensing terms see the file COPYING
 *
 ************************************************************************/
#include <stdio.h>
#include <iostream>
typedef long long Long64_t;
int main()
{
   Long64_t *w=new Long64_t[5];
   Long64_t x=999741748;
   Long64_t y=162909875;
   w[0]=x<<31;
   w[0]+=y;
   std::cout << "cout:        " << w[0] << std::endl;
   printf("printf ll:   %lld\n", w[0]);
   printf("one less ll: %lld\n", 2146929056215846578LL);
   printf("again ll:    %lld\n", w[0]);
   // warnings are intentional
   printf("printf l:    %ld\n", w[0]);
   printf("one less l:  %ld\n", 2146929056215846578LL);
   printf("again l:     %ld\n", w[0]);
   
   delete []w;
      
  return 0;
}
back to top