diff --git a/g3d/src/TPoints3DABC.cxx b/g3d/src/TPoints3DABC.cxx index f5befc8d73bdfa2b18849ff1f265247acabb0c02..2a00860695940d1ed774589da83b33e9dfc2383a 100644 --- a/g3d/src/TPoints3DABC.cxx +++ b/g3d/src/TPoints3DABC.cxx @@ -1,7 +1,7 @@ -// @(#)root/g3d:$Name$:$Id$ +// @(#)root/g3d:$Name: $:$Id: TPoints3DABC.cxx,v 1.1.1.1 2000/05/16 17:00:43 rdm Exp $ // Author: Valery Fine(fine@mail.cern.ch) 04/05/99 -// @(#)root/g3d:$Name$:$Id$ +// @(#)root/g3d:$Name: $:$Id: TPoints3DABC.cxx,v 1.1.1.1 2000/05/16 17:00:43 rdm Exp $ // Author: Valery Fine(fine@mail.cern.ch) 24/04/99 #include "TPoints3DABC.h" @@ -87,12 +87,12 @@ Int_t TPoints3DABC::DistancetoLine(Int_t px, Int_t py, Float_t x1, Float_t y1, F Float_t B = xx2*xx2 + yy2*yy2; Float_t C = x1x2*x1x2 + y1y2*y1y2; if (C <= 0) return 9999; - Float_t c = TMath::Sqrt(C); + Float_t c = TMath::Sqrt((Double_t)C); Float_t u = (A - B + C)/(2*c); Float_t D = TMath::Abs(A - u*u); if (D < 0) return 9999; - return Int_t(TMath::Sqrt(D) - 0.5*float(lineWidth)); + return Int_t(TMath::Sqrt((Double_t)D) - 0.5*float(lineWidth)); } //______________________________________________________________________________ diff --git a/g3d/src/TShape.cxx b/g3d/src/TShape.cxx index 6d4bc02c949d6976879655549bd8bed580fae3d0..5a9839d46d24dde7f329538f8f2e574e1619e751 100644 --- a/g3d/src/TShape.cxx +++ b/g3d/src/TShape.cxx @@ -1,4 +1,4 @@ -// @(#)root/g3d:$Name: $:$Id: TShape.cxx,v 1.2 2000/11/21 20:18:43 brun Exp $ +// @(#)root/g3d:$Name: $:$Id: TShape.cxx,v 1.3 2002/02/02 11:56:14 brun Exp $ // Author: Nenad Buncic 17/09/95 /************************************************************************* @@ -103,7 +103,7 @@ Int_t TShape::ShapeDistancetoPrimitive(Int_t numPoints, Int_t px, Int_t py) if (dpoint2 < dist) dist = (Int_t)dpoint2; } delete [] points; - return Int_t(TMath::Sqrt(Float_t(dist))); + return Int_t(TMath::Sqrt(Double_t(dist))); } //______________________________________________________________________________ void TShape::Paint(Option_t *) diff --git a/hist/src/TH3.cxx b/hist/src/TH3.cxx index fc0f98661e75577f834ad3d51d4ebce6c3edd374..974b84f599741fd7c28f361274ee1f8a24ffb124 100644 --- a/hist/src/TH3.cxx +++ b/hist/src/TH3.cxx @@ -1,4 +1,4 @@ -// @(#)root/hist:$Name: $:$Id: TH3.cxx,v 1.37 2003/07/07 20:52:08 brun Exp $ +// @(#)root/hist:$Name: $:$Id: TH3.cxx,v 1.38 2003/08/11 08:27:12 brun Exp $ // Author: Rene Brun 27/10/95 /************************************************************************* @@ -897,9 +897,9 @@ Double_t TH3::KolmogorovTest(TH1 *h2, Option_t *option) const // Get Kolmogorov probability Double_t factnm; - if (afunc1) factnm = TMath::Sqrt(sum2); - else if (afunc2) factnm = TMath::Sqrt(sum1); - else factnm = TMath::Sqrt(sum1*sum2/(sum1+sum2)); + if (afunc1) factnm = TMath::Sqrt((Double_t)sum2); + else if (afunc2) factnm = TMath::Sqrt((Double_t)sum1); + else factnm = TMath::Sqrt((Double_t)sum1*sum2/(sum1+sum2)); Double_t z = dfmax*factnm; Double_t z2 = dfmax2*factnm; @@ -1120,7 +1120,7 @@ TH1D *TH3::ProjectionZ(const char *name, Int_t ixmin, Int_t ixmax, Int_t iymin, if (h1->GetSumw2N()) { e = GetBinError(bin); e1 = h1->GetBinError(binz); - newerror = TMath::Sqrt(e*e + e1*e1); + newerror = TMath::Sqrt((Double_t)(e*e + e1*e1)); } if (cont) { h1->Fill(fZaxis.GetBinCenter(binz), cont); @@ -1378,7 +1378,7 @@ TH1 *TH3::Project3D(Option_t *option) const if (cont) h1->Fill(fXaxis.GetBinCenter(ixbin), cont); if (computeErrors) { e = GetBinError(bin); - newerror = TMath::Sqrt(e*e + e1*e1); + newerror = TMath::Sqrt((Double_t)(e*e + e1*e1)); h1->SetBinError(ix,newerror); } break; @@ -1388,7 +1388,7 @@ TH1 *TH3::Project3D(Option_t *option) const if (cont) h1->Fill(fYaxis.GetBinCenter(iybin), cont); if (computeErrors) { e = GetBinError(bin); - newerror = TMath::Sqrt(e*e + e1*e1); + newerror = TMath::Sqrt((Double_t)(e*e + e1*e1)); h1->SetBinError(iy,newerror); } break; @@ -1398,7 +1398,7 @@ TH1 *TH3::Project3D(Option_t *option) const if (cont) h1->Fill(fZaxis.GetBinCenter(izbin), cont); if (computeErrors) { e = GetBinError(bin); - newerror = TMath::Sqrt(e*e + e1*e1); + newerror = TMath::Sqrt((Double_t)(e*e + e1*e1)); h1->SetBinError(iz,newerror); } break; @@ -1408,7 +1408,7 @@ TH1 *TH3::Project3D(Option_t *option) const if (cont) h2->Fill(fYaxis.GetBinCenter(iybin),fXaxis.GetBinCenter(ixbin), cont); if (computeErrors) { e = GetBinError(bin); - newerror = TMath::Sqrt(e*e + e1*e1); + newerror = TMath::Sqrt((Double_t)(e*e + e1*e1)); h2->SetCellError(iy,ix,newerror); } break; @@ -1418,7 +1418,7 @@ TH1 *TH3::Project3D(Option_t *option) const if (cont) h2->Fill(fXaxis.GetBinCenter(ixbin),fYaxis.GetBinCenter(iybin), cont); if (computeErrors) { e = GetBinError(bin); - newerror = TMath::Sqrt(e*e + e1*e1); + newerror = TMath::Sqrt((Double_t)(e*e + e1*e1)); h2->SetCellError(ix,iy,newerror); } break; @@ -1428,7 +1428,7 @@ TH1 *TH3::Project3D(Option_t *option) const if (cont) h2->Fill(fZaxis.GetBinCenter(izbin),fXaxis.GetBinCenter(ixbin), cont); if (computeErrors) { e = GetBinError(bin); - newerror = TMath::Sqrt(e*e + e1*e1); + newerror = TMath::Sqrt((Double_t)(e*e + e1*e1)); h2->SetCellError(iz,ix,newerror); } break; @@ -1438,7 +1438,7 @@ TH1 *TH3::Project3D(Option_t *option) const if (cont) h2->Fill(fXaxis.GetBinCenter(ixbin),fZaxis.GetBinCenter(izbin), cont); if (computeErrors) { e = GetBinError(bin); - newerror = TMath::Sqrt(e*e + e1*e1); + newerror = TMath::Sqrt((Double_t)(e*e + e1*e1)); h2->SetCellError(ix,iz,newerror); } break; @@ -1448,7 +1448,7 @@ TH1 *TH3::Project3D(Option_t *option) const if (cont) h2->Fill(fZaxis.GetBinCenter(izbin),fYaxis.GetBinCenter(iybin), cont); if (computeErrors) { e = GetBinError(bin); - newerror = TMath::Sqrt(e*e + e1*e1); + newerror = TMath::Sqrt((Double_t)(e*e + e1*e1)); h2->SetCellError(iz,iy,newerror); } break; @@ -1458,7 +1458,7 @@ TH1 *TH3::Project3D(Option_t *option) const if (cont) h2->Fill(fYaxis.GetBinCenter(iybin),fZaxis.GetBinCenter(izbin), cont); if (computeErrors) { e = GetBinError(bin); - newerror = TMath::Sqrt(e*e + e1*e1); + newerror = TMath::Sqrt((Double_t)(e*e + e1*e1)); h2->SetCellError(iy,iz,newerror); } break; diff --git a/hist/src/TSpectrum.cxx b/hist/src/TSpectrum.cxx index 8d9028e67d597ca4072c21ef039c442a2673ac93..3674e08bb666efd59b1ce5a8745f52c298a4c9d4 100644 --- a/hist/src/TSpectrum.cxx +++ b/hist/src/TSpectrum.cxx @@ -1,4 +1,4 @@ -// @(#)root/hist:$Name: $:$Id: TSpectrum.cxx,v 1.12 2003/07/10 10:53:40 brun Exp $ +// @(#)root/hist:$Name: $:$Id: TSpectrum.cxx,v 1.13 2003/07/11 09:42:22 brun Exp $ // Author: Miroslav Morhac 27/05/99 ///////////////////////////////////////////////////////////////////////////// @@ -1608,7 +1608,7 @@ const char* TSpectrum::Smooth1Markov(float *source, int size, int aver_window) a = 1; else - a = TMath::Sqrt(a + nip); + a = TMath::Sqrt((Double_t)(a + nip)); b = b / a; b = TMath::Exp(b); sp = sp + b; @@ -1622,7 +1622,7 @@ const char* TSpectrum::Smooth1Markov(float *source, int size, int aver_window) a = 1; else - a = TMath::Sqrt(a + nim); + a = TMath::Sqrt((Double_t)(a + nim)); b = b / a; b = TMath::Exp(b); sm = sm + b; diff --git a/matrix/src/TMatrix.cxx b/matrix/src/TMatrix.cxx index 64f8a7bc8a939cd7a7bc95cf52434f97eeb34aa1..9b1a7adab2766c05063512620b7c114f552c3889 100644 --- a/matrix/src/TMatrix.cxx +++ b/matrix/src/TMatrix.cxx @@ -1,4 +1,4 @@ -// @(#)root/matrix:$Name: $:$Id: TMatrix.cxx,v 1.45 2003/07/17 10:10:24 brun Exp $ +// @(#)root/matrix:$Name: $:$Id: TMatrix.cxx,v 1.46 2003/07/17 13:42:08 brun Exp $ // Author: Fons Rademakers 03/11/97 /************************************************************************* @@ -689,7 +689,7 @@ TMatrix &TMatrix::Sqrt() Real_t *ep; for (ep = fElements; ep < fElements+fNelems; ep++) if (*ep >= 0) - *ep = TMath::Sqrt(*ep); + *ep = TMath::Sqrt((Double_t)*ep); else Error("Sqrt", "(%d,%d)-th element, %g, is negative, can't take the square root", (ep-fElements) % fNrows + fRowLwb, @@ -951,7 +951,7 @@ TMatrix &TMatrix::NormByDiag(const TVector &v, Option_t *option) for (irow = 0; irow < fNrows; irow++) { Int_t icol; for (icol = 0; icol < fNcols; icol++) { - Double_t val = TMath::Sqrt(TMath::Abs(pv[irow]*pv[icol])); + Double_t val = TMath::Sqrt((Double_t)TMath::Abs(pv[irow]*pv[icol])); Assert(val != 0.0); mp[irow*fNcols+icol] /= val; } @@ -960,7 +960,7 @@ TMatrix &TMatrix::NormByDiag(const TVector &v, Option_t *option) for (irow = 0; irow < fNrows; irow++) { Int_t icol; for (icol = 0; icol < fNcols; icol++) { - Double_t val = TMath::Sqrt(TMath::Abs(pv[irow]*pv[icol])); + Double_t val = TMath::Sqrt((Double_t)TMath::Abs(pv[irow]*pv[icol])); mp[irow*fNcols+icol] *= val; } } @@ -1527,7 +1527,7 @@ Int_t TMatrix::Pdcholesky(const Real_t *a, Real_t *u, const Int_t n) if (k == j) { if (u[off_k+j] < 0) status = 1; - u[off_k+j] = TMath::Sqrt(TMath::Abs(u[off_k+j])); + u[off_k+j] = TMath::Sqrt((Double_t)TMath::Abs(u[off_k+j])); } else u[off_k+j] = u[off_k+j]/u[off_k+k]; diff --git a/matrix/src/TVector.cxx b/matrix/src/TVector.cxx index 90d911c3d1a5fa456bd634cb1580fc14bea24691..9ba9316c0e37a9effb38938076c36794c64e165b 100644 --- a/matrix/src/TVector.cxx +++ b/matrix/src/TVector.cxx @@ -1,4 +1,4 @@ -// @(#)root/matrix:$Name: $:$Id: TVector.cxx,v 1.27 2003/05/26 03:36:11 brun Exp $ +// @(#)root/matrix:$Name: $:$Id: TVector.cxx,v 1.28 2003/07/12 19:43:59 brun Exp $ // Author: Fons Rademakers 05/11/97 /************************************************************************* @@ -663,7 +663,7 @@ TVector &TVector::Sqrt() Real_t *ep; for (ep = fElements; ep < fElements+fNrows; ep++) if (*ep >= 0) - *ep = TMath::Sqrt(*ep); + *ep = TMath::Sqrt((Double_t)*ep); else Error("Sqrt", "(%d)-th element, %g, is negative, can't take the square root", (ep-fElements) + fRowLwb, *ep); diff --git a/test/Event.cxx b/test/Event.cxx index d76e45bae0b55e25785a5908d418432923a782b7..5ee913104e1717a938b0ad5661a38f2f715bc1da 100644 --- a/test/Event.cxx +++ b/test/Event.cxx @@ -1,4 +1,4 @@ -// @(#)root/test:$Name: $:$Id: Event.cxx,v 1.19 2002/08/20 15:21:42 brun Exp $ +// @(#)root/test:$Name: $:$Id: Event.cxx,v 1.20 2003/01/30 06:40:32 brun Exp $ // Author: Rene Brun 19/08/96 //////////////////////////////////////////////////////////////////////// @@ -287,7 +287,7 @@ Track::Track(Float_t random) : TObject(),fTriggerBits(64) gRandom->Rannor(px,py); fPx = px; fPy = py; - fPz = TMath::Sqrt(px*px+py*py); + fPz = TMath::Sqrt((Double_t)(px*px+py*py)); fRandom = 1000*random; if (fRandom < 10) fMass2 = 0.106; else if (fRandom < 100) fMass2 = 0.8; diff --git a/test/Event.h b/test/Event.h index af894543d3aa88495529c09827b99fb926c4f319..c45955c51121d5062c3b6463e68dcd315a410ee0 100644 --- a/test/Event.h +++ b/test/Event.h @@ -53,7 +53,7 @@ public: Float_t GetPx() const { return fPx; } Float_t GetPy() const { return fPy; } Float_t GetPz() const { return fPz; } - Float_t GetPt() const { return TMath::Sqrt(fPx*fPx + fPy*fPy); } + Float_t GetPt() const { return TMath::Sqrt((Double_t)(fPx*fPx + fPy*fPy)); } Float_t GetRandom() const { return fRandom; } Float_t GetBx() const { return fBx; } Float_t GetBy() const { return fBy; }