Skip to content

Commit

Permalink
quiet some issues with Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
kthohr committed Oct 28, 2018
1 parent 2dee8e8 commit 0050336
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ build_script:
- .\sqrt.test
- .\tan.test
- .\tanh.test
- ls -al
2 changes: 1 addition & 1 deletion include/gcem_incl/binomial_coef.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ binomial_coef(const pT n, const pT k)
// if
internal::binomial_coef_recur<pT,eT>(n,k) :
// else
internal::binomial_coef_recur<ullint_t,ullint_t>(n,k) );
internal::binomial_coef_recur<ullint_t,ullint_t>(static_cast<ullint_t>(n),static_cast<ullint_t>(k)) );
}

#endif
20 changes: 12 additions & 8 deletions include/gcem_incl/factorial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ factorial_table(const T x)
T(20922789888000) );
}

template<typename T>
template<typename T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
constexpr
T
factorial_integer(const T x)
factorial_recur(const T x)
{
return( x == T(0) ? T(1) :
x == T(1) ? x :
Expand All @@ -61,7 +61,15 @@ factorial_integer(const T x)
// if
factorial_table(x) :
// else
x*factorial_integer(x-1) );
x*factorial_recur(x-1) );
}

template<typename T, typename std::enable_if<!std::is_integral<T>::value>::type* = nullptr>
constexpr
T
factorial_recur(const T x)
{
return tgamma(x + 1);
}

}
Expand All @@ -80,11 +88,7 @@ constexpr
T
factorial(const T x)
{
return( std::is_integral<T>::value ? \
// if
internal::factorial_integer(x) :
// else
tgamma(x + 1) );
return internal::factorial_recur(x);
}

#endif

0 comments on commit 0050336

Please sign in to comment.