Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:03:30

0001 // $Id: RandomEngine.icc,v 1.4 2010/10/25 18:18:47 garren Exp $
0002 // -*- C++ -*-
0003 // 
0004 // -----------------------------------------------------------------------
0005 //                             HEP Random
0006 //                       --- HepRandomEngine ---
0007 //                 inlined functions implementation file
0008 // -----------------------------------------------------------------------
0009 // This file is part of Geant4 (simulation toolkit for HEP).
0010 
0011 // =======================================================================
0012 // Gabriele Cosmo - Created: 5th September 1995
0013 //                - Added == and != operators: 19th November 1996
0014 //                - Moved seeds table to HepRandom: 19th March 1998
0015 // =======================================================================
0016 
0017 #include <cmath>
0018 
0019 namespace CLHEP {
0020 
0021 inline bool HepRandomEngine::operator==(const HepRandomEngine& engine) {
0022   return (this==&engine);
0023 }
0024 
0025 inline bool HepRandomEngine::operator!=(const HepRandomEngine& engine) {
0026   return (this!=&engine);
0027 }
0028 
0029 inline double HepRandomEngine::exponent_bit_32()  {
0030   static const double exponent_bit_32 = std::pow(2.0, 32.0);
0031   return exponent_bit_32;
0032 }
0033 
0034 inline double HepRandomEngine::mantissa_bit_12()  {
0035   static const double mantissa_bit_12 = std::pow(0.5, 12.0);
0036   return mantissa_bit_12;
0037 }
0038 
0039 inline double HepRandomEngine::mantissa_bit_24()  {
0040   static const double mantissa_bit_24 = std::pow(0.5, 24.0);
0041   return mantissa_bit_24;
0042 }
0043 
0044 inline double HepRandomEngine::twoToMinus_32()  {
0045   static const double twoToMinus_32 = std::ldexp(1.0, -32);
0046   return twoToMinus_32;
0047 }
0048 
0049 inline double HepRandomEngine::twoToMinus_48()  {
0050   static const double twoToMinus_48 = std::ldexp(1.0, -48);
0051   return twoToMinus_48;
0052 }
0053 
0054 inline double HepRandomEngine::twoToMinus_49()  {
0055   static const double twoToMinus_49 = std::ldexp(1.0, -49);
0056   return twoToMinus_49;
0057 }
0058 
0059 inline double HepRandomEngine::twoToMinus_53()  {
0060   static const double twoToMinus_53 = std::ldexp(1.0, -53);
0061   return twoToMinus_53;
0062 }
0063 
0064 inline double HepRandomEngine::nearlyTwoToMinus_54()  {
0065   static const double nearlyTwoToMinus_54 = std::ldexp(1.0,  -54)
0066                                           - std::ldexp(1.0, -100);
0067   return nearlyTwoToMinus_54;
0068 }
0069 
0070 }  // namespace CLHEP