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

Introduce a modulo operator #4

Open
stevenheidel opened this issue Feb 17, 2019 · 2 comments
Open

Introduce a modulo operator #4

stevenheidel opened this issue Feb 17, 2019 · 2 comments
Assignees
Labels
2024.1 Changes for the 2024.1 specification.

Comments

@stevenheidel
Copy link
Contributor

Tracking a value modulo 2*pi is a relatively useful thing to do, perhaps Quil's expressions should be extended to include a modulo operator.

Since % is already used for variables this wouldn't be a good choice. Instead we could:

  • introduce a function mod(dividend, divisor), although this would be the first named function in quil with >1 arguments
  • introduce some other symbol (maybe \)
@cbosborn
Copy link

@stylewarning would this be written

MOD remainder dividend divisor

@stylewarning
Copy link
Member

another option is to do division and remainder simultaneously

@stylewarning stylewarning self-assigned this Feb 15, 2024
@stylewarning stylewarning added the 2024.1 Changes for the 2024.1 specification. label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024.1 Changes for the 2024.1 specification.
Projects
None yet
Development

No branches or pull requests

3 participants