Skip to content

Commit 0050336

Browse files
committed
quiet some issues with Windows build
1 parent 2dee8e8 commit 0050336

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ build_script:
5353
- .\sqrt.test
5454
- .\tan.test
5555
- .\tanh.test
56+
- ls -al

include/gcem_incl/binomial_coef.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ binomial_coef(const pT n, const pT k)
5757
// if
5858
internal::binomial_coef_recur<pT,eT>(n,k) :
5959
// else
60-
internal::binomial_coef_recur<ullint_t,ullint_t>(n,k) );
60+
internal::binomial_coef_recur<ullint_t,ullint_t>(static_cast<ullint_t>(n),static_cast<ullint_t>(k)) );
6161
}
6262

6363
#endif

include/gcem_incl/factorial.hpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ factorial_table(const T x)
4949
T(20922789888000) );
5050
}
5151

52-
template<typename T>
52+
template<typename T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
5353
constexpr
5454
T
55-
factorial_integer(const T x)
55+
factorial_recur(const T x)
5656
{
5757
return( x == T(0) ? T(1) :
5858
x == T(1) ? x :
@@ -61,7 +61,15 @@ factorial_integer(const T x)
6161
// if
6262
factorial_table(x) :
6363
// else
64-
x*factorial_integer(x-1) );
64+
x*factorial_recur(x-1) );
65+
}
66+
67+
template<typename T, typename std::enable_if<!std::is_integral<T>::value>::type* = nullptr>
68+
constexpr
69+
T
70+
factorial_recur(const T x)
71+
{
72+
return tgamma(x + 1);
6573
}
6674

6775
}
@@ -80,11 +88,7 @@ constexpr
8088
T
8189
factorial(const T x)
8290
{
83-
return( std::is_integral<T>::value ? \
84-
// if
85-
internal::factorial_integer(x) :
86-
// else
87-
tgamma(x + 1) );
91+
return internal::factorial_recur(x);
8892
}
8993

9094
#endif

0 commit comments

Comments
 (0)