diff --git a/src/wignerSymbols-cpp.cpp b/src/wignerSymbols-cpp.cpp index db5154e..a58e58e 100644 --- a/src/wignerSymbols-cpp.cpp +++ b/src/wignerSymbols-cpp.cpp @@ -223,7 +223,7 @@ double wigner3j(double l1, double l2, double l3, double l1min = std::max(std::fabs(l2-l3),std::fabs(m1)); // We fetch the proper value in the array. - int index = (int)l1-l1min; + int index = (int)(l1-l1min); return wigner3j(l2,l3,m1,m2,m3)[index]; } @@ -448,7 +448,7 @@ double wigner6j(double l1, double l2, double l3, // We compute l1min and the position of the array we will want. double l1min = std::max(std::fabs(l2-l3),std::fabs(l5-l6)); - int index = (int)l1-l1min; + int index = (int)(l1-l1min); return wigner6j(l2,l3,l4,l5,l6)[index]; } diff --git a/src/wignerSymbols-fortran.cpp b/src/wignerSymbols-fortran.cpp index 34e503b..14b3602 100644 --- a/src/wignerSymbols-fortran.cpp +++ b/src/wignerSymbols-fortran.cpp @@ -62,7 +62,7 @@ double wigner3j_f(double l1, double l2, double l3, drc3jj_wrap(l2,l3,m2,m3,&l1min,&l1max,thrcof,size,&ierr); // We fetch and return the value with the proper l1 value. - int index = (int)l1-l1min; + int index = (int)(l1-l1min); return thrcof[index]; } @@ -102,7 +102,7 @@ double wigner6j_f(double l1, double l2, double l3, drc6j_wrap(l2,l3,l4,l5,l6,&l1min,&l1max,sixcof,size,&ierr); // We fetch and return the coefficient with the proper l1 value. - int index = (int)l1-l1min; + int index = (int)(l1-l1min); return sixcof[index]; } }