Skip to content

Commit

Permalink
Changed a comment and replaced ssize_t with int32_t as ssize_t is not…
Browse files Browse the repository at this point in the history
… a part of standard C/C++
  • Loading branch information
dsuponitskiy-duality committed Oct 3, 2023
1 parent ea9c9c7 commit a742e96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pke/lib/scheme/ckksrns/ckksrns-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ uint32_t Degree(const std::vector<double>& coefficients) {
OPENFHE_THROW(math_error, "The coefficients vector can not be empty");
}

ssize_t indx = coefficientsSize;
while( --indx >= 0 ) {
int32_t indx = coefficientsSize;
while (--indx >= 0) {
if (coefficients[indx])
break;
}

// we get indx equal to "-1" if all coefficients are zeroes
return static_cast<uint32_t>(( indx < 0 ) ? 0 : indx);
// indx becomes negative (-1) only when all coefficients are zeroes. in this case we return 0
return static_cast<uint32_t>((indx < 0) ? 0 : indx);
}

/* f and g are vectors of coefficients of the two polynomials. We assume their dominant
Expand Down

0 comments on commit a742e96

Please sign in to comment.