Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A small bug related to creation of evaluation domains of size 1. #192

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading