guppylang icon indicating copy to clipboard operation
guppylang copied to clipboard

Implement broken/missing arithmetic methods

Open mark-koch opened this issue 2 years ago • 0 comments

  • [ ] __pow__ for int and float. Either add native support in Hugr or implement via loop? Note that there are also some typing issues: 2 ** 2 = 2 is int but 2 ** -1 = 0.5 is float in Python!
  • [ ] __round__ for float
  • [ ] __lshift__ etc are broken: Shifts in the arithmetic extension treat the RHS as unsigned. We either have to change this or have special logic that treats compilation of negative shifts
  • [ ] Double check the Hugr spec for iabs: Does it return signed or unsigned ints?
  • [x] Use devision ops with panic once they are added to Hugr (c.f. #52)

mark-koch avatar Sep 26 '23 14:09 mark-koch