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

How should integer division work? 🤔 #2

Open
aslilac opened this issue Jan 15, 2022 · 0 comments
Open

How should integer division work? 🤔 #2

aslilac opened this issue Jan 15, 2022 · 0 comments

Comments

@aslilac
Copy link
Owner

aslilac commented Jan 15, 2022

I want an easy option for "give me both the quotient and remainder"

Options:

  • We can have the user specify two output registers, but should that be required?
  • We could use r, rh0, rq0, and rb0 as the default when no remainder register is specified
  • We could just make you specify a complete register set if you want the remainder, and only give you the quotient otherwise

Also, what could the luna syntax be like if we wanted to allow you to specify two inputs and a remainder register, while still allowing the quotient output register to default to the register of the first input? Maybe something like div x 4 . y or div x 4 - y or div x 4 _ y, which would divide the contents of x by 4, store the quotient in x, and store the remainder in y.

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

No branches or pull requests

1 participant