mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
fix warning: shuffle_order
This commit is contained in:
parent
ddac080ec0
commit
88322b3d0a
1 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/array.hpp>
|
#include <sprout/array.hpp>
|
||||||
#include <sprout/operation/fixed/set.hpp>
|
#include <sprout/operation/fixed/set.hpp>
|
||||||
|
#include <sprout/math/compare.hpp>
|
||||||
#include <sprout/random/random_result.hpp>
|
#include <sprout/random/random_result.hpp>
|
||||||
#include <sprout/random/linear_congruential.hpp>
|
#include <sprout/random/linear_congruential.hpp>
|
||||||
#include <sprout/random/detail/signed_unsigned_tools.hpp>
|
#include <sprout/random/detail/signed_unsigned_tools.hpp>
|
||||||
|
@ -112,8 +113,8 @@ namespace sprout {
|
||||||
return generate_1(
|
return generate_1(
|
||||||
rng_(),
|
rng_(),
|
||||||
k == 1 ? BaseUnsigned(0)
|
k == 1 ? BaseUnsigned(0)
|
||||||
: brange < std::numeric_limits<BaseUnsigned>::max() / k ? BaseUnsigned(k * off / (brange + 1))
|
: sprout::math::less(brange, std::numeric_limits<BaseUnsigned>::max() / k) ? BaseUnsigned(k * off / (brange + 1))
|
||||||
: brange < std::numeric_limits<std::uintmax_t>::max() / k
|
: sprout::math::less(brange, std::numeric_limits<std::uintmax_t>::max() / k)
|
||||||
? static_cast<BaseUnsigned>(static_cast<std::uintmax_t>(off) * k / (static_cast<std::uintmax_t>(brange) + 1))
|
? static_cast<BaseUnsigned>(static_cast<std::uintmax_t>(off) * k / (static_cast<std::uintmax_t>(brange) + 1))
|
||||||
//: static_cast<BaseUnsigned>(sprout::random::detail::muldiv(off, k, static_cast<std::uintmax_t>(brange) + 1)) // ???
|
//: static_cast<BaseUnsigned>(sprout::random::detail::muldiv(off, k, static_cast<std::uintmax_t>(brange) + 1)) // ???
|
||||||
: throw std::domain_error("shuffle_order_engine<>: Sorry, not implemented.")
|
: throw std::domain_error("shuffle_order_engine<>: Sorry, not implemented.")
|
||||||
|
|
Loading…
Reference in a new issue