00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitCore * 00004 * @(#)root/roofitcore:$Id: RooNumber.cxx 24285 2008-06-16 15:05:15Z wouter $ 00005 * Authors: * 00006 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * 00007 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * 00008 * * 00009 * Copyright (c) 2000-2005, Regents of the University of California * 00010 * and Stanford University. All rights reserved. * 00011 * * 00012 * Redistribution and use in source and binary forms, * 00013 * with or without modification, are permitted according to the terms * 00014 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * 00015 *****************************************************************************/ 00016 00017 ////////////////////////////////////////////////////////////////////////////// 00018 // 00019 // BEGIN_HTML 00020 // Class RooNumber implements numeric constants used by RooFit 00021 // END_HTML 00022 // 00023 00024 #include "RooFit.h" 00025 #include "RooNumber.h" 00026 00027 ClassImp(RooNumber) 00028 ; 00029 00030 #ifdef HAS_NUMERIC_LIMITS 00031 00032 #include <numeric_limits.h> 00033 Double_t RooNumber::_Infinity= numeric_limits<Double_t>::infinity(); 00034 #else 00035 00036 // This assumes a well behaved IEEE-754 floating point implementation. 00037 // The next line may generate a compiler warning that can be ignored. 00038 Double_t RooNumber::_Infinity= 1.0e30 ; //1./0.; 00039 00040 #endif 00041 00042 00043 //_____________________________________________________________________________ 00044 Double_t RooNumber::infinity() 00045 { 00046 // Return internal infinity representation 00047 00048 return _Infinity ; 00049 } 00050 00051 00052 //_____________________________________________________________________________ 00053 Int_t RooNumber::isInfinite(Double_t x) 00054 { 00055 // Return true if x is infinite by RooNumBer internal specification 00056 00057 return (x >= +_Infinity) ? +1 : ((x <= -_Infinity) ? -1 : 0); 00058 } 00059