From 88322b3d0aef8779c7e61f5222b9fcbab7f53894 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Fri, 21 Dec 2012 23:21:50 +0900 Subject: [PATCH] fix warning: shuffle_order --- sprout/random/shuffle_order.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sprout/random/shuffle_order.hpp b/sprout/random/shuffle_order.hpp index c2c89a92..24d899d8 100644 --- a/sprout/random/shuffle_order.hpp +++ b/sprout/random/shuffle_order.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -112,8 +113,8 @@ namespace sprout { return generate_1( rng_(), k == 1 ? BaseUnsigned(0) - : brange < std::numeric_limits::max() / k ? BaseUnsigned(k * off / (brange + 1)) - : brange < std::numeric_limits::max() / k + : sprout::math::less(brange, std::numeric_limits::max() / k) ? BaseUnsigned(k * off / (brange + 1)) + : sprout::math::less(brange, std::numeric_limits::max() / k) ? static_cast(static_cast(off) * k / (static_cast(brange) + 1)) //: static_cast(sprout::random::detail::muldiv(off, k, static_cast(brange) + 1)) // ??? : throw std::domain_error("shuffle_order_engine<>: Sorry, not implemented.")