quil icon indicating copy to clipboard operation
quil copied to clipboard

Introduce a modulo operator

Open stevenheidel opened this issue 6 years ago • 2 comments

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 \)

stevenheidel avatar Feb 17 '19 23:02 stevenheidel

@stylewarning would this be written

MOD remainder dividend divisor

cbosborn avatar Jul 23 '19 15:07 cbosborn

another option is to do division and remainder simultaneously

stylewarning avatar Jul 23 '19 19:07 stylewarning