• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版3766d64f351dc7bb47cffa82ec66b9db102c5aa5 (tree)
时间2013-01-22 04:26:37
作者Katsuhiko Nishimra <ktns.87@gmai...>
CommiterKatsuhiko Nishimra

Log Message

Call boost::math::factorial in MolDS_base::Factorial. #30557

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1237 1136aad2-a195-0410-b898-f5ea1d11b9d8

更改概述

差异

--- a/src/base/MathUtilities.cpp
+++ b/src/base/MathUtilities.cpp
@@ -23,6 +23,7 @@
2323 #include<math.h>
2424 #include<stdexcept>
2525 #include<boost/format.hpp>
26+#include<boost/math/special_functions/factorials.hpp>
2627 #include"PrintController.h"
2728 #include"MolDSException.h"
2829 #include"Uncopyable.h"
@@ -41,12 +42,7 @@ int Factorial(int n){
4142 ss << "Error in base::MathUtility::Factorial: n<0 \n";
4243 throw MolDSException(ss.str());
4344 }
44- else if (n>1){
45- return n*Factorial(n-1);
46- }
47- else{
48- return 1;
49- }
45+ return static_cast<int>(boost::math::factorial<double>(n));
5046 }
5147
5248 // nCk