Skip to content

Fix failing case of subtraction losing Units class#61

Merged
olbrich merged 2 commits intoolbrich:masterfrom
agworld:fix_subtract_class
Jan 25, 2013
Merged

Fix failing case of subtraction losing Units class#61
olbrich merged 2 commits intoolbrich:masterfrom
agworld:fix_subtract_class

Conversation

@stwr667
Copy link
Contributor

@stwr667 stwr667 commented Jan 25, 2013

Currently if you subtract 2 Units that are zero, the result is not a Unit, but the scalar object. However if you add them, it respects the Units class correctly.

Here is the fix and 2 tests that prove it.

Currently, if you subtract a zero unit from another, it will revert
to the scalar class, rather than maintain its Unit class. However
for addition, it is still respected.
This fix caters for the loss of Units class when two zero Units
are subtracted.
olbrich added a commit that referenced this pull request Jan 25, 2013
Fix failing case of subtraction losing Units class
@olbrich olbrich merged commit fddab9b into olbrich:master Jan 25, 2013
@olbrich
Copy link
Owner

olbrich commented Jan 25, 2013

Thanks!

@stwr667
Copy link
Contributor Author

stwr667 commented Jan 29, 2013

No, thank you! 😄

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

Successfully merging this pull request may close these issues.

2 participants