Skip to content

Mod does not correctly consider units #1

Description

@TarVK

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions