Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def normalize_interval(a, b):
- if a <= b: return (a, b)
- else: return (a, a)
- # good version
- def intersect(oth):
- return interval(normalize_interval(min(self.hi, oth,hi), max(self.low, oth.low)))
Add Comment
Please, Sign In to add comment