Geant4  10.03
RandomEngine.icc
Go to the documentation of this file.
1 // $Id:$
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- HepRandomEngine ---
7 // inlined functions implementation file
8 // -----------------------------------------------------------------------
9 // This file is part of Geant4 (simulation toolkit for HEP).
10 
11 // =======================================================================
12 // Gabriele Cosmo - Created: 5th September 1995
13 // - Added == and != operators: 19th November 1996
14 // - Moved seeds table to HepRandom: 19th March 1998
15 // =======================================================================
16 
17 #include <cmath>
18 
19 namespace CLHEP {
20 
21 inline bool HepRandomEngine::operator==(const HepRandomEngine& engine) {
22  return (this==&engine);
23 }
24 
25 inline bool HepRandomEngine::operator!=(const HepRandomEngine& engine) {
26  return (this!=&engine);
27 }
28 
29 inline double HepRandomEngine::exponent_bit_32() {
30  static const double exponent_bit_32 = std::pow(2.0, 32.0);
31  return exponent_bit_32;
32 }
33 
34 inline double HepRandomEngine::mantissa_bit_12() {
35  static const double mantissa_bit_12 = std::pow(0.5, 12.0);
36  return mantissa_bit_12;
37 }
38 
39 inline double HepRandomEngine::mantissa_bit_24() {
40  static const double mantissa_bit_24 = std::pow(0.5, 24.0);
41  return mantissa_bit_24;
42 }
43 
44 inline double HepRandomEngine::twoToMinus_32() {
45  static const double twoToMinus_32 = std::ldexp(1.0, -32);
46  return twoToMinus_32;
47 }
48 
49 inline double HepRandomEngine::twoToMinus_48() {
50  static const double twoToMinus_48 = std::ldexp(1.0, -48);
51  return twoToMinus_48;
52 }
53 
54 inline double HepRandomEngine::twoToMinus_49() {
55  static const double twoToMinus_49 = std::ldexp(1.0, -49);
56  return twoToMinus_49;
57 }
58 
59 inline double HepRandomEngine::twoToMinus_53() {
60  static const double twoToMinus_53 = std::ldexp(1.0, -53);
61  return twoToMinus_53;
62 }
63 
64 inline double HepRandomEngine::nearlyTwoToMinus_54() {
65  static const double nearlyTwoToMinus_54 = std::ldexp(1.0, -54)
66  - std::ldexp(1.0, -100);
67  return nearlyTwoToMinus_54;
68 }
69 
70 } // namespace CLHEP