mirror of
https://github.com/Findus23/rebound-collisions.git
synced 2024-09-19 15:53:48 +02:00
4 lines
136 B
Python
4 lines
136 B
Python
def clamp(n: float, smallest: float, largest: float) -> float:
|
|
assert smallest < largest
|
|
return max(smallest, min(n, largest))
|
|
|