Anonymous user
Box the compass: Difference between revisions
→{{header|Python}}: Modulo already handles the negatives.
m (→{{header|Python}}: Spelling) |
(→{{header|Python}}: Modulo already handles the negatives.) |
||
Line 29:
def degrees2compasspoint(d):
d = (d % 360) + 360/64
majorindex, minor = divmod(d, 90.)
majorindex = int(majorindex)
|