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

Fix fft_fr.IsPowerOfTwo(). (#83) #638

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

cody-littley
Copy link
Contributor

@cody-littley cody-littley commented Jul 15, 2024

Why are these changes needed?

This change fixes #87

The function fft_fr.IsPowerOfTwo() did not return the correct response for 0.

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@cody-littley cody-littley self-assigned this Jul 15, 2024
@cody-littley cody-littley marked this pull request as ready for review July 15, 2024 15:40
@@ -132,6 +132,7 @@ func (fs *FFTSettings) InplaceFFT(vals []fr.Element, out []fr.Element, inv bool)
}
}

// IsPowerOfTwo Returns true if the provided integer v is a power of 2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: returns

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced Returns with returns

Signed-off-by: Cody Littley <[email protected]>
Copy link
Contributor

@dmanc dmanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm as long as nothing depends on this specific behavior (I doubt it).

@cody-littley cody-littley merged commit ff3d573 into Layr-Labs:master Jul 15, 2024
6 checks passed
@cody-littley cody-littley deleted the 87-fix-IsPowerOfTwo branch July 15, 2024 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Division by Zero in InplaceFFT Function
3 participants