--- trunk/src/math/LegendrePolynomial.cpp 2006/01/30 22:25:27 876 +++ trunk/src/math/LegendrePolynomial.cpp 2006/05/17 21:51:42 963 @@ -59,8 +59,9 @@ namespace oopse { //P_{l+1}= \frac{(2l+1)(x)P_l-l P_{l-1}{l+1} for (int i = 2; i <= maxPower; ++i) { DoublePolynomial pn; - - pn = polyList_[i-1] * x * static_cast((2*i+1)/(i+1)) - polyList_[i-2] * static_cast(i/(i+1)); + RealType tmp1 = (2.0*i-1.0)/i; + RealType tmp2 = (i-1.0)/i; + pn = polyList_[i-1] * x * tmp1 - polyList_[i-2] * tmp2; polyList_.push_back(pn); } }