Skip to content

Instantly share code, notes, and snippets.

@willhardy
Created April 2, 2012 01:05
Show Gist options
  • Save willhardy/2279849 to your computer and use it in GitHub Desktop.
Save willhardy/2279849 to your computer and use it in GitHub Desktop.
Python modulo
from decimal import Decimal
print(-5 % 360) # 355
print(-5.0 % 360) # 355.0
print(Decimal(-5) % 360) # -5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment