Skip to content

Commit

Permalink
Fix generator compilation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Oct 26, 2015
1 parent 5467611 commit 42b82b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/hep/mc/generator_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,22 @@
#include <cmath>
#include <cstddef>
#include <limits>
#include <type_traits>

namespace
{

template <typename T, typename R>
inline std::size_t random_number_usage()
{
using S = typename std::remove_reference<R>::type;

// the number of random bits
std::size_t const b = std::numeric_limits<T>::digits;

// the number of different numbers the generator can generate
long double const r = static_cast <long double> (R::max())
- static_cast <long double> (R::min()) + 1.0L;
long double const r = static_cast <long double> (S::max())
- static_cast <long double> (S::min()) + 1.0L;

// the number of bits needed to hold the value of 'r'
std::size_t const log2r = std::log2(r);
Expand Down

0 comments on commit 42b82b2

Please sign in to comment.