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

Correct integer division in pow modifiers #529

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

jakelishman
Copy link
Contributor

Summary

These would have been evaluted to the integer 0 instead of the intended floating-point value 0.5.

Details and comments

Fix #528

These would have been evaluted to the integer `0` instead of the
intended floating-point value `0.5`.
hodgestar
hodgestar previously approved these changes Apr 17, 2024
@hodgestar
Copy link
Contributor

I would also be happy with Lev's (I think) suggestion of just writing 0.5.

@jakelishman
Copy link
Contributor Author

Me too - I actually wrote this PR before Lev made that issue, but after I had to run off very quickly at the end of the TSC meeting I didn't have time to push it. Happy to switch to whichever.

@hodgestar
Copy link
Contributor

I'll put in a +0.5 for switching to 0.5 as slightly nicer looking.

@jakelishman jakelishman merged commit 6960fa1 into openqasm:main Apr 30, 2024
11 checks passed
@jakelishman jakelishman deleted the correct-pow branch April 30, 2024 16:33
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.

Integer math in stdgates.inc
2 participants