openfhe-development icon indicating copy to clipboard operation
openfhe-development copied to clipboard

Potential bug: incorrect comparison of double values

Open dsuponitskiy opened this issue 2 years ago • 0 comments

src/pke/lib/scheme/ckksrns/ckksrns-utils.cpp: uint32_t Degree(const std::vector& coefficients) { uint32_t deg = 1; for (int i = coefficients.size() - 1; i > 0; i--) { if (coefficients[i] == 0) { <==== this comparison is almost never true when coefficients[i] holds zero deg += 1; } else break; } return coefficients.size() - deg; }

dsuponitskiy avatar Nov 05 '22 18:11 dsuponitskiy