Skip to content

Floor division by another quantity with the same unit is not dimensionless #205

Closed

Description

@kohlerca

Hello everyone,

I am trying to use the // operator with a Quantity array. However, the returned unit is wrong, as I would expect dimensionless when dividing by another quantity with the same unit.

Here is a short snippet to reproduce the behavior:

q = pq.Quantity([43, 40, 34, 25], units=pq.ms)

print("/", q / (3 * pq.ms))
print("//", q // (3 * pq.ms))

The output is:

/ [14.33333333 13.33333333 11.33333333  8.33333333] dimensionless
// [14. 13. 11.  8.] ms

Version information:
Python 3.9.12
quantities==0.13.0

Thank you!

Activity

  1. added a commit that references this issue on Jul 7, 2022
    99448bd
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