Skip to content

Conversation

@hfwittmann
Copy link

from mod import Mod
Mod(25, 35) // 12
should yield 5, because 5*12=60 which is 25 more the 35.
The current implementation however leads to en error:

Mod(25, 35) // 12
ValueError: the value (25 % 35) cannot be inverted

Therefore I propose the change.

from mod import Mod
Mod(25, 35) // 12
should yield 5, because 5*12=60 which is 25 more the 35. 
The current implementation however leads to en error:
>> Mod(25, 35) // 12
ValueError: the value (25 % 35) cannot be inverted

Therefore I propose the change.
Copy link
Owner

@yoeo yoeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request @hfwittmann,

This change is find with me, would you mind adding a unit-test that checks the issue you found ?
Division operator unit tests

I'll bump a new version with your fix as soon as it is merged.

And sorry for the late reply.

mod.py Outdated

inverted = (other * self.inverse)
return inverted.inverse
return self._value* converted.inverse
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to make the style-checker happy, could you add a space before the * ? :-)

@hfwittmann hfwittmann requested a review from yoeo July 17, 2022 10:16
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