We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
pint returns a wrong value for modulo of a negative number.
from pint import UnitRegistry u = UnitRegistry() foo = -180 % 360 print(foo) >> 180 bar = -180 * u.deg % 360 print(bar) >> 20446.480624709635 degree
python = 3.9.0 pint = 0.20.1
The text was updated successfully, but these errors were encountered:
You should use :
bar = -180 * u.deg % 360 * u.deg
Or use the magnitude for your operation, pint assume dimensionless as radians so it will basically be equivalent to :
radians
-180 degree % 360 radians
Sorry, something went wrong.
See #1344 (comment)
No branches or pull requests
Problem:
pint returns a wrong value for modulo of a negative number.
Minimal Example:
Versions:
python = 3.9.0
pint = 0.20.1
The text was updated successfully, but these errors were encountered: