add sprout/math/comparison.hpp

This commit is contained in:
bolero-MURAKAMI 2012-07-06 23:10:49 +09:00
parent d51bd06eda
commit 1c65d59971
20 changed files with 379 additions and 109 deletions

View file

@ -87,8 +87,7 @@ namespace sprout {
private:
public:
static SPROUT_CONSTEXPR RealType init_log_1mp(RealType p) {
using sprout::log;
return log(1 - p);
return sprout::log(1 - p);
}
private:
public:
@ -97,10 +96,8 @@ namespace sprout {
private:
template<typename Engine, typename Random>
SPROUT_CONSTEXPR sprout::random::random_result<Engine, geometric_distribution> generate_1(Random const& rnd) const {
using sprout::log;
using sprout::floor;
return sprout::random::random_result<Engine, geometric_distribution>(
static_cast<IntType>(floor(log(RealType(1) - rnd.result()) / log_1mp_)),
static_cast<IntType>(sprout::floor(sprout::log(RealType(1) - rnd.result()) / log_1mp_)),
rnd.engine(),
*this
);