ROOT:Tips Tricks

From StrelaWiki
Jump to navigation Jump to search

float/double

linux, gcc 4.9, glibc 2.20

root [1] float_double()
float  min = 1.17549e-38
float  max = 3.40282e+38
double min = 2.22507e-308
double max = 1.79769e+308
float  epsilon = 0.000000119209289550781250000000000000000000000000000000000000 => 1.19209e-07
double epsilon = 0.000000000000000222044604925031308084726333618164062500000000 => 2.22045e-16


number    1234567890123456789012345.1234567890123456789012345
as float  1234567946798590058299392.000000 => 1.23457e+24
as double 1234567890123456824475648.000000 => 1.23457e+24

number    1234567890123456789012345.0
as float  1234567946798590058299392.000000 => 1.23457e+24
as double 1234567890123456824475648.000000 => 1.23457e+24

number    0.1234567890123456789012345
as float  0.123456791043281555175781250000000000000000000000000000000000 => 0.123457
as double 0.123456789012345677369886232099815970286726951599121093750000 => 0.123457

number    1234567890123456789012345 (no decimal)
as float  1096246353119412224.000000 => 1.09625e+18
as double 1096246371337559936.000000 => 1.09625e+18

number    9.123e+22
as float  91230003119595695636480.000000 => 9.123e+22
as double 91230000000000004718592.000000 => 9.123e+22

number    9.123e+40
as float  inf => inf
as double 91230000000000006312383662990803305758720.000000 => 9.123e+40

number    9.123e-10
as float  0.000000000912300013311551083461381494998931884765625000000000 => 9.123e-10
as double 0.000000000912300000000000044597902336461579114734732343094947 => 9.123e-10

number    9.123e-50
as float  0.000000000000000000000000000000000000000000000000000000000000 => 0
as double 0.000000000000000000000000000000000000000000000000091230000000 => 9.123e-50

other

rootcint -f TStrawDict.cxx -c TStrawCham.h TStrawTrack.h StrawChamLinkDef.h
g++ -O -fPIC -I$ROOTSYS/include -c TStrawDict.cxx TStrawCham.cxx TStrawTrack.cxx
g++ -g -shared TStrawDict.o TStrawCham.o TStrawTrack.o TStrawDict.o -o libStraw.so


TImage *img = TImage::Create();
img->FromPad(c1, 520, 1100, 630, 600);
img->WriteImage("bla.png");


ProcInfo_t info;
gSystem->GetProcInfo(&info);
Printf("MemResident = %8ld kB, MemVirtual = %8ld kB", info.fMemResident, info.fMemVirtual);