1
0
Fork 0
mirror of https://github.com/Findus23/rebound-collisions.git synced 2024-09-19 15:53:48 +02:00
rebound-collisions/utils/math.py

4 lines
136 B
Python

def clamp(n: float, smallest: float, largest: float) -> float:
assert smallest < largest
return max(smallest, min(n, largest))