Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wrap(n, l, u)
- if l > u then ' Swap if bounds are backward
- t = l: l = u: u = t
- end if
- p = n
- p = p - l
- u = u - l
- p = p mod u
- if p < 0 then p = p + u
- wrap = p
- end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement