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