mlochbaum / BQN

An APL-like programming language

Home Page:https://mlochbaum.github.io/BQN/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3 | ¯4 results in 2 in BQNPAD and the online REPL

ionse opened this issue · comments

commented

I feel the result should be 1, unless I'm missing something...?

I did test with the left argument set to 1, 2, 4, 5, 6, 7, and 8, with correct results.

Well, ¯4+2×3 is 2 so I believe your arithmetic's just off. And here's Python:

>>> -4 % 3
2

In case there's any confusion about C-like modular division (although your comment about other arguments wouldn't be consistent with that), BQN always returns a non-negative result for positive 𝕨.

commented