Skip to content

Commit

Permalink
k should be size_t (#1031)
Browse files Browse the repository at this point in the history
  • Loading branch information
AZero13 authored Oct 1, 2023
1 parent fc3a395 commit 1722ef9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/boost/math/special_functions/legendre_stieltjes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class legendre_stieltjes

std::vector<Real> stieltjes_zeros;
std::vector<Real> legendre_zeros = legendre_p_zeros<Real>(m_m - 1);
int k;
size_t k;
if (m_m & 1)
{
stieltjes_zeros.resize(legendre_zeros.size() + 1, std::numeric_limits<Real>::quiet_NaN());
Expand All @@ -169,14 +169,14 @@ class legendre_stieltjes
k = 0;
}

while (k < (int)stieltjes_zeros.size())
while (k < stieltjes_zeros.size())
{
Real lower_bound;
Real upper_bound;
if (m_m & 1)
{
lower_bound = legendre_zeros[k - 1];
if (k == (int)legendre_zeros.size())
if (k == legendre_zeros.size())
{
upper_bound = 1;
}
Expand All @@ -188,7 +188,7 @@ class legendre_stieltjes
else
{
lower_bound = legendre_zeros[k];
if (k == (int)legendre_zeros.size() - 1)
if (k == legendre_zeros.size() - 1)
{
upper_bound = 1;
}
Expand Down

0 comments on commit 1722ef9

Please sign in to comment.