Re: [ROOT] Long64_t

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Fri Jun 27 2003 - 12:00:54 MEST


Hi Livia,

 printing of Long64_t via printf is only supported in the ROOT cvs head
version. We plan a new release very soon.

root [0] Long64_t i = kMaxLong64;
root [1] i
(long long)9223372036854775807
root [2] printf("i = %lld\n", i);
i = 9223372036854775807
root [3] .q


-- Fons


On Fri, 2003-06-27 at 11:42, Livia FERRO wrote:
>  Hi,
> 
>   now I am trying to "printf" or "cout" the variable "timestamp" below
> and I
> am not getting the correct expected result, of course, always from a
> root
> script... Is it possible at all to do this?
> 
> Thank you and best regards
> 
>                                         Livia Ferro
> 
> File to be read:
> 
> > 25 ext probe 1 21.93 1052989373314
> > 26 ext probe 1 19.95 1052989373362
> > 27 ext probe 1 20.25 1052989373418
> > 28 ext probe 1 20.40 1052989373465
> > 29 ext probe 1 20.36 1052989373517
> > 30 ext probe 1 19.99 1052989373620
> > 31 ext probe 1 21.17 1052989373683
> >
> 
> 
> 
> {
>   gROOT->Reset();
> 
>   int id;
>   char name1[10];
>   char name2[10];
>   int type;
>   float measure;
>   Long64_t timestamp;
>   int time,stamp;
>   char temp[200];
>   FILE *apre;
> 
>   apre = fopen("extprobe.dat","r");
> 
>   while(fgets(temp, sizeof(temp), apre) !=NULL) {
> 
>     sscanf(temp, "%d %s %s %d %g %6d%7d",
>     &id, &name1,&name2,  &type, &measure, &time,&stamp);
>     timestamp = time*100000000LL + stamp;
>     printf("%d %s %s %d %g %6d%7d\n",
>     id, name1,name2, type, measure, time,stamp);
>   }
> 
>     fclose(apre);
> }
> 
> 
> 
> 
-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET