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

Mod does not correctly consider units #1

Open
TarVK opened this issue Oct 4, 2023 · 0 comments
Open

Mod does not correctly consider units #1

TarVK opened this issue Oct 4, 2023 · 0 comments

Comments

@TarVK
Copy link
Member

TarVK commented Oct 4, 2023

Currently the mod operator ignores all units on the RHS, this is not correct.
Consider the following case:

1.01km mod 100meters

This would currently output 1.01km. Instead, these are the steps that should've been taken:

1.01km mod 100meters = 1.01km mod 0.1km = 0.01km

So unit conversion should be taking place, just like with subtraction. Modulo essentially represents: if I repeatedly subtract the RHS, what is the last value before getting a negative number. So it makes sense that units should be converted in the same way as with subtraction.

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