Skip to content

Commit

Permalink
A small bug related to creation of evaluation domains of size 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
martun committed Dec 11, 2024
1 parent d0a06c5 commit 99ff3a6
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ namespace nil {

typedef std::shared_ptr<evaluation_domain<FieldType, ValueType>> result_type;

// If m is 1, the value of (std::size_t(std::ceil(std::log2(m))) - 1) is -1, and stored in size_t it becomes a
// very large value.
if (m == 1) {
return result_type();
}

const std::size_t big = 1ul << (std::size_t(std::ceil(std::log2(m))) - 1);
const std::size_t rounded_small = (1ul << std::size_t(std::ceil(std::log2(m - big))));

Expand Down

0 comments on commit 99ff3a6

Please sign in to comment.