Add fix from issue #122

This commit is contained in:
Andrew Pardoe 2015-09-25 11:16:51 -07:00
parent 0599a69d4a
commit 033059103d

View File

@ -1775,7 +1775,7 @@ You could use cyclomatic complexity. Try "more that 10 logical path through." Co
constexpr int fac(int n)
{
constexpr int max_exp = 17; // constexpr enables this to be used in Expects
Expects(0<=x && x<max_exp); // prevent silliness and overflow
Expects(0<=n && n<max_exp); // prevent silliness and overflow
int x = 1;
for (int i=2; i<=n; ++i) x*= n;
return x;