mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
workaround for no c++11 numeric_limits
This commit is contained in:
parent
ce16e24637
commit
7a1974742a
110 changed files with 727 additions and 436 deletions
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/limits.hpp>
|
||||
#include <sprout/random/random_result.hpp>
|
||||
#include <sprout/random/detail/generator_bits.hpp>
|
||||
#include <sprout/detail/integer.hpp>
|
||||
|
@ -19,9 +19,9 @@ namespace sprout {
|
|||
typedef URNG base_type;
|
||||
typedef typename base_type::result_type base_result;
|
||||
typedef typename sprout::detail::uint_t<
|
||||
(std::numeric_limits<std::uintmax_t>::digits < std::numeric_limits<base_result>::digits)
|
||||
? std::numeric_limits<std::uintmax_t>::digits
|
||||
: std::numeric_limits<base_result>::digits
|
||||
(sprout::numeric_limits<std::uintmax_t>::digits < sprout::numeric_limits<base_result>::digits)
|
||||
? sprout::numeric_limits<std::uintmax_t>::digits
|
||||
: sprout::numeric_limits<base_result>::digits
|
||||
>::fast result_type;
|
||||
private:
|
||||
base_type rng_;
|
||||
|
@ -39,7 +39,7 @@ namespace sprout {
|
|||
return (
|
||||
result_type(2) << (
|
||||
NS_SSCRISK_CEL_OR_SPROUT::min(
|
||||
std::numeric_limits<result_type>::digits,
|
||||
sprout::numeric_limits<result_type>::digits,
|
||||
sprout::random::detail::generator_bits<base_type>::value()
|
||||
) - 1
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue