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

Division/multiplication between two dimensionless UnitScalars converts units type to int #54

Open
JCorson opened this issue Mar 7, 2017 · 0 comments
Labels

Comments

@JCorson
Copy link
Contributor

JCorson commented Mar 7, 2017

When dividing between two dimensionless UnitScalars, units is converted to an int. Is this the expected behavior?

Example:

>>> foo = UnitScalar(1000, units='mole')
>>> bar = UnitScalar(10, units='mole')
>>> baz =  foo / bar
>>> print baz.units
1
>>> print type(baz.units)
<class 'scimath.units.unit.unit'>

>>> foo_2 = UnitScalar(1000, units='none')
>>> bar_2 = UnitScalar(10, units='none')
>>> baz_2 = foo_2 / bar_2
>>> print baz_2.units
1
>>> print type(baz_2.units)
<type 'int'>
@JCorson JCorson added the Bug label Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant